Learning in public — this reference is being written in the open. Unfinished pages are excluded from search engines.
paged.IDML Reference
The Paged PlatformScripting (paged.*)

Sandbox & budgets

The execution model for paged.* scripts — a pure ECMAScript sandbox with no I/O, plus the runtime budgets that keep scripts safe — generated from the engine catalog.

Tier: ProProIIIreference

In short scripts run in a pure ECMAScript sandbox — no network, no filesystem, no timers, only paged.* and console.*. The rules below come straight from the engine catalog.

  • Scripts run in Boa (pure ECMAScript), NOT Node: no require/import, fetch, fs, setTimeout, or network. Use only paged.* and console.*.
  • Every paged.* write returns a boolean: true = applied, false = rejected (unknown id/path, bad value, or a failed precondition). Always check it and adapt.
  • Writes go through the editor's Operation channel, so paged.undo()/paged.redo() work exactly as in the UI.
  • Runtime budgets: ~10M loop iterations, recursion depth 512, and a ~2s wall-clock checked at every host call. Runaway scripts are aborted (non-catchable).
  • insertTextFrame/insertFrame create a new frame (and insertTextFrame mints a story) but return only a boolean — NOT the new id. To fill a freshly-created frame you need its story id: prefer inserting into existing template stories, or re-read paged.stories()/paged.tree() after creating to discover the new id.
  • Bounds are page-local points in [top, left, bottom, right] order. The document works in points (1/72 inch).