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

Examples

A working, editable playground for each paged.* host function — read the document, style frames, author text, apply styles, place images, and undo, each runnable against the real editor.

Tier: IntermediateIntermediateIIhow-to

In short every example below is a real, editable script running against the live editor. Each starts from a seeded starter document so the script has something to act on, and tells you what to look for on the canvas. Edit any snippet and press Run — the change applies and re-renders immediately.

Reads return JSON strings — parse them. paged.selection(), paged.tree(), paged.stories() and friends return a JSON string, not a live value. Call JSON.parse(...) first; the parsed elements are { kind, id } objects, addressed as the string `${kind}:${id}` (e.g. textFrame:u3).

Reading the document

paged.tree()readSceneTreeNode[] JSON#

Document hierarchy: spreads → pages → frames.

spreads → pages → frames. Page/spread ids are null by design; frames carry real ids.

Walk the document hierarchy
Open ↗paged.* · seed: article-spread
Loading editor…
Look for: The console prints the spread/page/frame tree; the article headline, body, pull-quote and picture frames appear under page 1.
Console
Run a script to see console output here.
paged.pages()readPageSummary[] JSON#

Pages with selfId + 1-based index + sizePt. selfId is the page id for insertFrame/insertTextFrame/insertPage (and the afterPageId of insertPage) — the only way a script can obtain a usable page id.

paged.pages() is the only way to get a usable page id (for insertFrame / insertPage).

List pages and their ids
Open ↗paged.* · seed: report-page
Loading editor…
Look for: The console prints the content page with its selfId and size in points.
Console
Run a script to see console output here.
paged.inspect(id)readElementProperties JSON#

Full property snapshot for one element (or storyRange).

A full property snapshot for the selected frame — the source of valid settable paths.

Inspect every property of one element
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: The console prints the frame’s full property set as JSON.
Console
Run a script to see console output here.
paged.get(id, path)readvalue | null#

Read one property value of the addressed element.

paged.get reads one property without the full inspect payload.

Read a single property value
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: The console prints the frame’s bounds [top, left, bottom, right].
Console
Run a script to see console output here.

Styling frames

paged.set(id, path, value)writebool#

Set a property (see settablePaths) on the addressed element. null clears.

Read the selection, address it as kind:id, then write two properties. paged.set re-renders, so the change is immediate.

Fill and rotate the selected frame
Open ↗paged.* · seed: flyer
Loading editor…
Look for: The flyer headline turns red and rotates 12°.
Console
Run a script to see console output here.

Authoring content

paged.insertTextFrame(pageId, [t,l,b,r])authorstring (created id) | null#

Create an empty text-pourable frame at page-local point bounds (mints a story) and select it. Returns the new textFrame:<id> address, or null on failure.

Get a page id, create a frame (it returns its new id and is auto-selected), then insert text into its story.

Create a text frame and pour text into it
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A new text frame with a sentence of text appears in the open middle of the page, between the header and footer furniture.
Console
Run a script to see console output here.
paged.insertText(storyId, offset, text)authorbool#

Insert plain text at a story body offset; \n splits paragraphs.

Story body edits by character offset; \n splits paragraphs.

Insert and delete text in a story
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A prefix is inserted at the start of the story, then the first word is deleted again.
Console
Run a script to see console output here.
paged.applyStyle(storyId, start, end, styleRef)authorbool#

Apply a paragraph/character style to a story range. Scope inferred from the ref prefix (CharacterStyle/… else Paragraph).

Scope is inferred from the ref prefix (CharacterStyle/… else Paragraph).

Apply a paragraph style to a range
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The first line takes on the first paragraph style in the document.
Console
Run a script to see console output here.
paged.placeImage(frameId, uri, fit?)authorbool#

Place an image into a frame; fit is an optional fitting mode.

Create a graphic frame, then place an image into it with an optional fitting mode.

Place an image into a frame
Open ↗paged.* · seed: image-frame
Loading editor…
Look for: The graphic frame fills with the placed image.
Console
Run a script to see console output here.

History

paged.undo()historybool#

Undo the last mutation.

Every write lands on the same Operation channel as the UI, so undo/redo work exactly as in the editor.

Undo and redo a write
Open ↗paged.* · seed: flyer
Loading editor…
Look for: The headline turns red, then undo reverts it, then redo re-applies it.
Console
Run a script to see console output here.

Structure & geometry

paged.deleteElement(id)authorbool#

Delete a page item (kind:id address or bare self id).

Remove any frame, group, or shape from the page by id.

Delete an element
Open ↗paged.* · seed: two-frames
Loading editor…
Look for: The selected (graphic) frame disappears from the page.
Console
Run a script to see console output here.
paged.moveFrame(frameId, [a,b,c,d,tx,ty])writebool#

Set a frame's affine placement transform.

A 2×3 affine [a,b,c,d,tx,ty]; here a pure translate of 72pt right and down.

Move a frame by a transform
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: The frame shifts 72pt (one inch) down and to the right.
Console
Run a script to see console output here.
paged.resizeFrame(frameId, [t,l,b,r])writebool#

Set a frame's content-box bounds (re-paginating resize).

Set the frame’s [top, left, bottom, right] box directly.

Resize a frame to new bounds
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: The frame grows to fill more of the page.
Console
Run a script to see console output here.
paged.duplicatePage(pageId)authorstring | null#

Duplicate a single-page spread after the source; returns the new page selfId.

Returns the new page selfId — reusable as the next afterPageId.

Duplicate a page
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: The document grows from 1 to 2 pages (and the new page copies the frame).
Console
Run a script to see console output here.
paged.setElementSelection([id, ...])writebool#

Replace the element selection with the parseable ids.

Selection is app state (not undoable); set it to drive the Properties panel.

Select elements from a script
Open ↗paged.* · seed: catalog
Loading editor…
Look for: All six product tiles on the page become selected.
Console
Run a script to see console output here.
paged.dissolveGroup(groupId)authorbool#

Ungroup; members return to the group's paint slot.

createGroup bundles two elements; dissolveGroup returns the members to the page.

Group, then ungroup
Open ↗paged.* · seed: two-frames
Loading editor…
Look for: The two frames are grouped, then ungrouped again (watch the selection bounds).
Console
Run a script to see console output here.

Drawing

paged.insertOval(pageId, [t,l,b,r])authorstring | null#

Insert an Oval.

A graphic primitive — like insertLine / insertFrame, it returns the new element id.

Draw an oval
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A black oval appears in the open middle of the page, between the header and footer bands.
Console
Run a script to see console output here.
paged.insertLine(pageId, [x1,y1], [x2,y2])authorstring | null#

Insert a two-anchor open GraphicLine.

A graphic line between two page-local points.

Draw a line
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A diagonal line is drawn across the open middle of the page.
Console
Run a script to see console output here.

Styles & tables

paged.createParagraphStyle({id?,name?,basedOn?})authorstring | null#

Create a paragraph style; returns its selfId.

Style CRUD returns the new style id; pass it straight to applyStyle.

Create and apply a paragraph style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A new “Caption” style is created and applied to the first line.
Console
Run a script to see console output here.
paged.insertTable(storyId, spec)authorstring | null#

Create a <Table> at the end of a story; spec = { rows, cols, headerRows?, footerRows?, columnWidths?, rowHeights? }. Returns the table id.

Create a rows×cols table; the spec also accepts headerRows/footerRows/colWidths.

Insert a table into a story
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A 3×3 table appears at the start of the story.
Console
Run a script to see console output here.

Collections & document state

Every read returns a JSON string — parse it, then report a count or the first row.

paged.swatches()readSwatchSummary[] JSON#

Colour palette (selfId/name/kind).

Walk the document palette — the source of the Color/<id> refs you pass to frameFillColor / frameStrokeColor.

List the colour swatches
Open ↗paged.* · seed: swatches-and-styles
Loading editor…
Look for: The console prints each swatch name and kind (process, spot, …).
Console
Run a script to see console output here.
paged.gradients()readGradientSummary[] JSON#

Gradients.

Gradient swatches (linear / radial ramps) the document defines. A fresh document ships none until you add them.

List the document gradients
Open ↗paged.* · seed: swatches-and-styles
Loading editor…
Look for: The console reports the gradient count (0 on a blank palette).
Console
Run a script to see console output here.
paged.colorGroups()readColorGroupSummary[] JSON#

Colour groups.

Colour groups organise the palette into named folders (e.g. a brand set). Read them to mirror the Swatches panel grouping.

List the colour groups
Open ↗paged.* · seed: swatches-and-styles
Loading editor…
Look for: The console reports how many colour groups the document organises its palette into.
Console
Run a script to see console output here.
paged.layers()readLayerSummary[] JSON#

Document layers.

Organise artwork onto named layers, then read the stack back — each row carries name, visibility, lock, print state and z-order.

Read the layer stack
Open ↗paged.* · seed: report-page
Loading editor…
Look for: The console prints a Background → Artwork layer stack, bottom to top.
Console
Run a script to see console output here.
paged.paragraphStyles()readParagraphStyleSummary[] JSON#

Paragraph styles — the source of valid styleRefs for applyStyle.

The paragraph stylesheet — the source of the styleRefs you hand to applyStyle, plus each style BasedOn parent.

List the paragraph styles
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The console prints every paragraph style and its BasedOn parent.
Console
Run a script to see console output here.
paged.characterStyles()readCharacterStyleSummary[] JSON#

Character styles.

Character (inline) styles — the run-level counterpart to paragraph styles, for emphasis, small caps, a coloured lead-in.

List the character styles
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The console prints the character stylesheet.
Console
Run a script to see console output here.
paged.objectStyles()readObjectStyleSummary[] JSON#

Object styles.

Object styles bundle frame appearance (fill, stroke, effects, text-frame options) for one-click consistency across a layout.

List the object styles
Open ↗paged.* · seed: swatches-and-styles
Loading editor…
Look for: The console reports the object-style count.
Console
Run a script to see console output here.
paged.conditions()readConditionSummary[] JSON#

Conditional-text conditions.

Conditions tag text for show/hide versioning (e.g. a Draft watermark, EN vs DE copy). Read the ones this document defines.

List conditional-text conditions
Open ↗paged.* · seed: flyer
Loading editor…
Look for: The console reports how many conditions the document defines (none on a fresh document).
Console
Run a script to see console output here.
paged.conditionSets()readConditionSetSummary[] JSON#

Condition sets.

A condition set is a saved visibility snapshot across all conditions — one click to flip a document between, say, a print and a web variant.

List condition sets
Open ↗paged.* · seed: flyer
Loading editor…
Look for: The console reports the condition-set count.
Console
Run a script to see console output here.
paged.collection(name)readSummary[] JSON#

Generic typed-collection read by name; unknown name → "[]" + warning.

One generic accessor over every document collection — here the spreads, so you can enumerate the layout sheet by sheet.

Read any typed collection by name
Open ↗paged.* · seed: catalog
Loading editor…
Look for: The console prints each spread and its page count.
Console
Run a script to see console output here.
paged.documentMeta()readDocumentMeta JSON#

Document metadata (name/creator/modified/page count).

The single-shot document snapshot — page count, the new-object fill/stroke defaults, and the active colour-management settings.

Read whole-document metadata
Open ↗paged.* · seed: flyer
Loading editor…
Look for: The console prints the page count and the document default fill/stroke.
Console
Run a script to see console output here.
paged.stories()readStorySummary[] JSON#

Loaded stories with selfId + characterCount + paragraphCount. The source of valid story ids.

Every text flow with its character and paragraph counts plus an overset flag — the source of the story ids text edits address.

List the document stories
Open ↗paged.* · seed: article-spread
Loading editor…
Look for: The console prints each of the article’s stories with its character count and overset state.
Console
Run a script to see console output here.
paged.selection()readElementId[] JSON#

Current element selection.

What the user (or your last insert) has selected — the parsed element you address as kind:id for every property write.

Read the current selection
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: The console prints the selected frame address.
Console
Run a script to see console output here.
paged.contentSelection()readContentSelection JSON | null#

Current text caret / range.

The text-side selection (caret or highlighted range). Here we place a range over the first word, then read it back.

Read the text caret / range
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: The console reports a 5-character text range.
Console
Run a script to see console output here.

Selection

paged.clearSelection()writebool#

Clear the element selection.

Drop the element selection — e.g. to dismiss handles before exporting a clean preview.

Deselect everything
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: The selection count goes from 1 to 0.
Console
Run a script to see console output here.
paged.setContentSelection({storyId,start,end} | null)writebool#

Set or clear the text caret/range.

Drive the text caret like the Type tool — select a heading run so a follow-up style or edit lands exactly there.

Place a text range from a script
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The first heading word is highlighted as a text range.
Console
Run a script to see console output here.

Pages & masters

paged.insertPage(afterPageId?)authorstring (page selfId) | null#

Append a page after afterPageId (or at the end), inheriting the default master. Returns the new page's selfId (reusable as the next afterPageId), or null.

Append a page after a given one (it inherits the default master). Returns the new page selfId for chaining further inserts.

Add a page to the document
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: The document grows from 1 to 2 pages.
Console
Run a script to see console output here.
paged.deletePage(pageId)authorbool#

Delete a page.

Delete a page by id. We add a spare page first (you cannot delete a document down to zero pages), then remove it.

Remove a page
Open ↗paged.* · seed: report-page
Loading editor…
Look for: The page count goes 1 → 2 → 1.
Console
Run a script to see console output here.
paged.resizePage(pageId, [t,l,b,r])writebool#

Set a page's GeometricBounds in page-inner points.

Set a page GeometricBounds in points. Here we switch US Letter (612×792) to A4 (595.28×841.89 pt).

Change the page size to A4
Open ↗paged.* · seed: report-page
Loading editor…
Look for: The content page becomes narrower and taller (A4 proportions).
Console
Run a script to see console output here.
paged.applyMasterToPage(pageId, masterId?)writebool#

Apply a master to a page (omit/null detaches).

Masters carry shared furniture (running heads, folios). Apply the first master to a page; omit the id to detach it instead.

Apply a master to a page
Open ↗paged.* · seed: report-page
Loading editor…
Look for: The content page picks up the master spread (or detaches when none is defined).
Console
Run a script to see console output here.

Frames & threading

paged.insertFrame(pageId, [t,l,b,r])authorstring (created id) | null#

Create an empty graphic (non-text) frame and select it; the usual placeImage target. Returns the new frame's kind:id address, or null.

A non-text frame — the usual target for placeImage. Returns its kind:id address (and auto-selects it).

Draw a graphic (picture) frame
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A 20%-grey picture frame appears in the open middle of the page, ready for an image.
Console
Run a script to see console output here.
paged.createGroup([id, ...])authorbool#

Group two-or-more elements; <2 valid members returns false.

Bundle two-or-more page items so they move and transform as one unit (e.g. a logo lock-up). Needs ≥2 valid members.

Group elements together
Open ↗paged.* · seed: two-frames
Loading editor…
Look for: The two frames become a single selectable group.
Console
Run a script to see console output here.
paged.linkFrames(fromId, toId)authorbool#

Thread fromId's overflow into the empty frame toId.

When copy overflows one frame, thread it into a second so the text continues — the core of multi-frame article flow.

Thread a story across two frames
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: Overset copy in a short first frame flows on into a second frame below it.
Console
Run a script to see console output here.
paged.unlinkFrames(frameId)authorbool#

Break the text thread leaving a frame.

Cut the link leaving a frame so its overflow no longer pours onward — e.g. to re-route a story into a different frame.

Break a text thread
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A threaded pair is created on the page, then the thread out of the first frame is severed.
Console
Run a script to see console output here.

Vector paths

paged.insertPath(pageId, anchors, open, smooth?)authorstring | null#

Insert an arbitrary path; anchors = [{anchor:[x,y],left:[x,y],right:[x,y]}, …].

Build an arbitrary closed path from anchors — each is { anchor, left, right } (corner points repeat the anchor). Returns the new polygon address.

Draw a custom shape (a pennant)
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A solid triangular pennant appears in the open middle of the page.
Console
Run a script to see console output here.
paged.pathPointInsert(elemId, index, anchor, subpathStarts?)authorbool#

Insert an anchor into a path's flat PathPointArray at index.

Refine a custom path by inserting an anchor into its flat PathPointArray — turning a triangle into a quad here.

Add an anchor to a shape
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A fourth corner is added to the triangle, squaring it off.
Console
Run a script to see console output here.
paged.pathPointRemove(elemId, index)authorbool#

Remove the anchor at flat index.

Delete an anchor from a path by its flat index — simplifying a four-point shape back toward a triangle.

Remove a redundant anchor
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: One corner of a four-point shape is removed.
Console
Run a script to see console output here.
paged.pathPointCurveType(elemId, index, smooth)writebool#

Toggle an anchor between corner and smooth.

Flip one anchor between corner and smooth — rounding a hard vertex into a curved transition.

Smooth a corner point
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: The first corner of the shape becomes a smooth curve.
Console
Run a script to see console output here.
paged.pathPointSet(elemId, index, role, [x,y])writebool#

Write one Bezier handle (role = anchor|left|right).

Write a single Bezier handle (role = anchor | left | right) to reshape a path precisely.

Nudge one anchor handle
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: The apex of a triangle shifts to a new position.
Console
Run a script to see console output here.
paged.pathOpenAt(elemId, index)writebool#

Cut the path at the anchor at flat index.

Open a closed contour at a chosen anchor — turning a filled silhouette into an open stroked path.

Cut a closed path open
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A closed shape is split open at its first corner.
Console
Run a script to see console output here.
paged.outlineStroke(elemId, width, cap, join, miter)writebool#

Replace the path with its stroke-expansion outline.

Convert a stroked path into the filled outline of that stroke — so an 8pt rule becomes an editable band (cap/join = butt|round|square / miter|round|bevel).

Outline a rule into a filled shape
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A thick diagonal rule turns into a closed filled band.
Console
Run a script to see console output here.
paged.offsetPath(elemId, delta, join, miter)writebool#

Inset (delta<0) / outset (delta>0) a single closed contour.

Inset (delta < 0) or outset (delta > 0) a closed contour — e.g. to build a registration keyline just inside a shape.

Inset a shape (keyline)
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: The shape contracts by 10pt all round.
Console
Run a script to see console output here.
paged.simplifyPath(elemId, tolerance)writebool#

Re-express the path with fewer anchors within tolerance pt.

Re-express a path with fewer anchors within a pt tolerance — lightening a dense traced outline.

Simplify a path
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: The path is re-expressed within a 3pt tolerance.
Console
Run a script to see console output here.
paged.pathfinderBoolean(keptId, [otherIds], kind)authorbool#

Pathfinder boolean (kind = union|intersect|subtract|exclude).

Combine overlapping shapes into one silhouette (kind = union | intersect | subtract | exclude). The kept shape absorbs the others.

Merge shapes with Pathfinder
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: Two overlapping squares merge into a single union outline.
Console
Run a script to see console output here.

Tables

paged.insertTableRow(storyId, tableId, at)authorbool#

Insert an empty body row at index.

Insert an empty body row at an index — e.g. to add another line item to a price table.

Add a row to a spec table
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A four-row table gains a fifth row.
Console
Run a script to see console output here.
paged.deleteTableRow(storyId, tableId, at)authorbool#

Delete the body row at index.

Remove a body row by index — pruning a discontinued line item.

Delete a table row
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A four-row table drops to three rows.
Console
Run a script to see console output here.
paged.insertTableColumn(storyId, tableId, at)authorbool#

Insert an empty column at index.

Insert an empty column at an index — e.g. adding a "Unit price" column beside the description.

Add a column to a table
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A three-column table gains a fourth column.
Console
Run a script to see console output here.
paged.deleteTableColumn(storyId, tableId, at)authorbool#

Delete the column at index.

Remove a column by index — dropping a column the layout no longer needs.

Delete a table column
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A three-column table drops to two columns.
Console
Run a script to see console output here.
paged.insertHeaderRow(storyId, tableId)authorbool#

Insert a header-band row.

Promote a header band that repeats at the top of the table wherever it breaks across frames or pages.

Add a repeating header row
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The table gains a header band above the body rows.
Console
Run a script to see console output here.
paged.removeHeaderRow(storyId, tableId)authorbool#

Remove the first header row.

Drop the first header row — demoting it back into the body.

Remove the header band
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The header band is removed from the table.
Console
Run a script to see console output here.
paged.insertFooterRow(storyId, tableId)authorbool#

Insert a footer-band row.

Add a footer band that repeats at the bottom of the table — the natural home for a totals row.

Add a totals footer band
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The table gains a footer band below the body rows.
Console
Run a script to see console output here.
paged.removeFooterRow(storyId, tableId)authorbool#

Remove the last footer row.

Drop the last footer row from the table.

Remove the footer band
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The footer band is removed from the table.
Console
Run a script to see console output here.
paged.setCellSpan(storyId, tableId, row, col, rowSpan, columnSpan)writebool#

Set a cell's row/column span.

Set a cell row/column span — merge the top-left 2×2 block into one cell for a section title that spans columns.

Merge cells for a spanning title
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The top-left four cells merge into one spanning cell.
Console
Run a script to see console output here.
paged.setRowHeight(storyId, tableId, row, height?)writebool#

Set/clear a table row height in pt.

Give a row a fixed height in points — e.g. a roomy 28pt header band. Pass null to clear back to auto.

Set a fixed row height
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The first row becomes a fixed 28pt tall.
Console
Run a script to see console output here.
paged.setColumnWidth(storyId, tableId, col, width?)writebool#

Set/clear a table column width in pt.

Pin a column to a width in points — e.g. a 140pt label column. Pass null to clear back to auto.

Set a fixed column width
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The first column becomes a fixed 140pt wide.
Console
Run a script to see console output here.

Styles — create, rename, delete

paged.createCharacterStyle({id?,name?,basedOn?})authorstring | null#

Create a character style; returns its selfId.

Create an inline (run-level) style — here an "Emphasis" style for bolding a phrase consistently. Returns its selfId.

Define an Emphasis character style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A new Emphasis character style is added to the stylesheet.
Console
Run a script to see console output here.
paged.renameCharacterStyle(styleId, name)writebool#

Rename a character style.

Create a style, then give it a clearer display name.

Rename a character style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The style is renamed from Emph to Emphasis.
Console
Run a script to see console output here.
paged.deleteCharacterStyle(styleId)authorbool#

Delete a character style.

Clean up the stylesheet by removing a style you no longer need.

Delete an unused character style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A just-created character style is removed again.
Console
Run a script to see console output here.
paged.createObjectStyle({id?,name?,basedOn?})authorstring | null#

Create an object style; returns its selfId.

Create an object style — a reusable bundle of frame appearance (fill, stroke, effects). Returns its selfId.

Define a Photo Frame object style
Open ↗paged.* · seed: swatches-and-styles
Loading editor…
Look for: A new Photo Frame object style is added.
Console
Run a script to see console output here.
paged.renameObjectStyle(styleId, name)writebool#

Rename an object style.

Create an object style and rename it.

Rename an object style
Open ↗paged.* · seed: swatches-and-styles
Loading editor…
Look for: The object style is renamed.
Console
Run a script to see console output here.
paged.deleteObjectStyle(styleId)authorbool#

Delete an object style.

Remove an object style from the document.

Delete an object style
Open ↗paged.* · seed: swatches-and-styles
Loading editor…
Look for: A just-created object style is removed.
Console
Run a script to see console output here.
paged.createCellStyle({id?,name?,basedOn?})authorstring | null#

Create a cell style; returns its selfId.

Create a cell style — reusable cell fill, insets and edge strokes for table cells. Returns its selfId.

Define a Header Cell style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A new Header Cell style is added.
Console
Run a script to see console output here.
paged.renameCellStyle(styleId, name)writebool#

Rename a cell style.

Create a cell style and rename it.

Rename a cell style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The cell style is renamed.
Console
Run a script to see console output here.
paged.deleteCellStyle(styleId)authorbool#

Delete a cell style.

Remove a cell style from the document.

Delete a cell style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A just-created cell style is removed.
Console
Run a script to see console output here.
paged.createTableStyle({id?,name?,basedOn?})authorstring | null#

Create a table style; returns its selfId.

Create a table style — a reusable look for an entire table (banding, borders). Returns its selfId.

Define a Price List table style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A new Price List table style is added.
Console
Run a script to see console output here.
paged.renameTableStyle(styleId, name)writebool#

Rename a table style.

Create a table style and rename it.

Rename a table style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The table style is renamed.
Console
Run a script to see console output here.
paged.deleteTableStyle(styleId)authorbool#

Delete a table style.

Remove a table style from the document.

Delete a table style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A just-created table style is removed.
Console
Run a script to see console output here.
paged.renameParagraphStyle(styleId, name)writebool#

Rename a paragraph style.

Create a paragraph style and give it a production-ready name.

Rename a paragraph style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The Body style is renamed to Body Text.
Console
Run a script to see console output here.
paged.deleteParagraphStyle(styleId)authorbool#

Delete a paragraph style.

Remove a paragraph style from the stylesheet.

Delete a paragraph style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A just-created paragraph style is removed.
Console
Run a script to see console output here.
paged.setStyleProperty(collection, styleId, path, value)writebool#

Set one property on a style definition (collection = paragraph|character|object|cell|table; path = a settablePaths name).

Edit a style definition itself (collection = paragraph|character|object|cell|table) so every paragraph using it updates at once.

Set body type to 10pt on a style
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The Body style is set to 10pt with 4pt space-after.
Console
Run a script to see console output here.

Numbering lists

paged.createNumberingList(spec)authorstring | null#

Create a <NumberingList>; returns its id.

Create a <NumberingList> — the named counter a paragraph style points at for ordered procedures. Returns its id.

Define a numbered-list resource
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A new Steps numbering list is defined.
Console
Run a script to see console output here.
paged.editNumberingList(listId, spec)writebool#

Edit a <NumberingList>.

Edit a numbering list so its counter continues across stories — keeping one sequence over a multi-frame procedure.

Continue numbering across stories
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The list is set to continue numbering across stories.
Console
Run a script to see console output here.
paged.deleteNumberingList(listId)authorbool#

Delete a <NumberingList>.

Remove a numbered-list resource from the document.

Delete a numbering list
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A just-created numbering list is removed.
Console
Run a script to see console output here.

Sections & page numbering

paged.insertSection(pageId, {prefix?,style?,start?})authorbool#

Anchor a <Section> at a page.

Anchor a <Section> at a page to restart page numbering — here lower-roman with an "i" front-matter scheme.

Start a front-matter section
Open ↗paged.* · seed: report-page
Loading editor…
Look for: A section begins at page 1 with lower-roman numbering.
Console
Run a script to see console output here.
paged.editSection(sectionId, {prefix?,style?,start?})writebool#

Edit a <Section>; prefix/start are tri-state (omit ⇒ leave, null ⇒ clear).

Edit a section discovered from the sections collection — give it an "A-" chapter prefix on the folio.

Set a section prefix
Open ↗paged.* · seed: report-page
Loading editor…
Look for: The section gains an A- page-number prefix.
Console
Run a script to see console output here.
paged.deleteSection(sectionId)authorbool#

Delete a <Section>.

Remove a section so its page-numbering restart reverts to the previous scheme.

Delete a section
Open ↗paged.* · seed: report-page
Loading editor…
Look for: A just-created section is removed.
Console
Run a script to see console output here.

Conditional text

paged.setConditionVisible(conditionId, visible)writebool#

Flip a condition's visibility.

Flip a condition visible/hidden — e.g. hide the Draft watermark for a final export. Acts on the first defined condition.

Hide a conditional-text condition
Open ↗paged.* · seed: flyer
Loading editor…
Look for: The first condition is hidden (or reports false when none are defined).
Console
Run a script to see console output here.
paged.activateConditionSet(setId)writebool#

Activate one <ConditionSet> ("show only this set").

Switch the document to one saved visibility set ("show only this set") — e.g. flip to the German-language variant.

Activate a condition set
Open ↗paged.* · seed: flyer
Loading editor…
Look for: The first condition set activates (or reports false when none exist).
Console
Run a script to see console output here.

Layers

paged.layerInsert(position, name)authorbool#

Append a layer at the zero-based stacking index.

Append a layer at a zero-based stacking index — here an "Annotations" layer above the artwork.

Add a named layer
Open ↗paged.* · seed: report-page
Loading editor…
Look for: An Annotations layer is added to the stack.
Console
Run a script to see console output here.
paged.layerMove(layerId, newIndex)writebool#

Reorder a layer to a new zero-based index.

Move a layer to a new zero-based index — sending the background to the very bottom.

Reorder a layer in the stack
Open ↗paged.* · seed: report-page
Loading editor…
Look for: The Background layer moves to the bottom of the stack.
Console
Run a script to see console output here.
paged.layerRemove(layerId)authorbool#

Remove a layer.

Delete a layer by id — tidying up an empty scratch layer.

Remove an empty layer
Open ↗paged.* · seed: report-page
Loading editor…
Look for: A just-added layer is removed again.
Console
Run a script to see console output here.

Ruler guides

paged.insertGuide(spreadId, orientation, position, pageIndex?)authorbool#

Insert a ruler guide (orientation = vertical|horizontal).

Add a ruler guide (orientation = vertical | horizontal) at a page-local position — here a vertical guide at 144pt (2 inches).

Place a column guide
Open ↗paged.* · seed: report-page
Loading editor…
Look for: A vertical guide appears two inches in from the left.
Console
Run a script to see console output here.
paged.moveGuide(guideId, position)writebool#

Move a guide along its perpendicular axis.

Move a guide along its perpendicular axis. We add one, read its minted id from the spread, then slide it.

Nudge a ruler guide
Open ↗paged.* · seed: report-page
Loading editor…
Look for: The guide slides from 144pt to 216pt.
Console
Run a script to see console output here.
paged.deleteGuide(guideId)authorbool#

Delete a guide.

Remove a guide by its minted id (read from the spread guides list).

Delete a ruler guide
Open ↗paged.* · seed: report-page
Loading editor…
Look for: A just-added guide is removed.
Console
Run a script to see console output here.

Fields

paged.insertField(storyId, offset, fieldKind)authorbool#

Insert a field marker; fieldKind = "pageNumber" | "nextPageNumber" | { placeholder: { plugin, key, value? } }.

Drop a field marker into a story (fieldKind = "pageNumber" | "nextPageNumber" | a plugin placeholder) — the live folio in a running footer.

Insert an automatic page number
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: A page-number marker is inserted at the start of the story.
Console
Run a script to see console output here.
paged.setFieldValue(storyId, offset, value?)writebool#

Update a placeholder field's cached display value (null ⇒ unresolved).

Insert a plugin placeholder field, then set its cached display value — the heart of a data-merge (e.g. a price).

Resolve a data-merge placeholder
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: A SKU placeholder is inserted then resolved to a value.
Console
Run a script to see console output here.

Text & history

paged.deleteRange(storyId, start, end)authorbool#

Delete the [start, end) character range of a story.

Remove a [start, end) character range from a story — here the heading word, by character offset.

Delete a run of text
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: The first word (the heading) is deleted from the story.
Console
Run a script to see console output here.
paged.redo()historybool#

Redo the last undone mutation.

Every write lands on the same Operation channel as the UI, so redo re-applies exactly what undo reverted.

Redo an undone change
Open ↗paged.* · seed: flyer
Loading editor…
Look for: The headline turns red, undo reverts it, redo re-applies the red fill.
Console
Run a script to see console output here.

Document & colour settings

paged.setDocumentDefaults({fill?,stroke?,weight?})writebool#

Set the new-object fill/stroke/weight defaults (whole-triple).

Define the fill/stroke/weight new frames inherit — here no fill, a 1pt black stroke, so drawn boxes start as keylines.

Set new-object defaults
Open ↗paged.* · seed: flyer
Loading editor…
Look for: New objects default to a 1pt black stroke with no fill.
Console
Run a script to see console output here.
paged.setColorSettings({cmykProfileName?,rgbPolicy?,intent?,bpc?})writebool#

Replace the document colour-management settings.

Replace the document colour-management policy — preserve embedded profiles, relative-colorimetric intent, black-point compensation on.

Configure colour management
Open ↗paged.* · seed: flyer
Loading editor…
Look for: The document colour-management settings are updated.
Console
Run a script to see console output here.
paged.setProofSetup({profileName?,simulatePaperWhite?,intent?})writebool#

Soft-proofing configuration (profileName null turns proofing off).

Configure on-screen soft-proofing — simulate a SWOP CMYK press with paper-white simulation. Pass profileName null to turn proofing off.

Soft-proof for CMYK press
Open ↗paged.* · seed: flyer
Loading editor…
Look for: Soft-proofing is configured for a SWOP CMYK press.
Console
Run a script to see console output here.
paged.setInkSetting(spotId, {convertToProcess?,aliasTo?})writebool#

Replace one ink's output-time settings.

Adjust an ink output setting (Ink Manager) — convert a spot to process at output. This blank document defines no spot inks, so it reports false cleanly.

Convert a spot ink to process
Open ↗paged.* · seed: flyer
Loading editor…
Look for: The first spot ink converts to process (or reports false when none exist).
Console
Run a script to see console output here.
paged.setUseStandardLabForSpots(enabled)writebool#

Prefer spots' Lab primary over their CMYK alternate in previews.

Preview spot colours from their Lab primary rather than the CMYK alternate — closer to the swatch-book appearance.

Prefer Lab for spot previews
Open ↗paged.* · seed: flyer
Loading editor…
Look for: Spot-colour previews switch to their Lab values.
Console
Run a script to see console output here.
paged.importSwatchLibrary(bytes, groupName?)authorbool#

Import an .ase swatch library (bytes = number[]) as one undoable op.

Import an Adobe Swatch Exchange (.ase) library as one undoable step. Pass the file as a number[] of bytes.

Import an .ase swatch library
Open ↗paged.* · seed: swatches-and-styles
Loading editor…
Look for: With real .ase bytes the palette grows; headless (no bytes) it reports false.
Console
Run a script to see console output here.
paged.setPluginMetadata(elemId, key, value?, caller?)writebool#

Write one Label key/value pair on a leaf page item (value null deletes).

Write a key/value pair into a frame Label, in the reserved x-paged:<plugin> namespace, with a { v, data } envelope — e.g. a review status.

Tag a frame with plugin metadata
Open ↗paged.* · seed: image-frame
Loading editor…
Look for: The selected frame carries an x-paged:review label.
Console
Run a script to see console output here.
paged.replaceImageBytes(frameId, bytes?)writebool#

Commit inline image bytes (number[] of u8) on a graphic frame; null clears.

Commit inline image bytes on a graphic frame (a number[] of u8), or pass null to clear them. Here we clear the selected frame.

Clear a frame inline image
Open ↗paged.* · seed: image-frame
Loading editor…
Look for: The frame inline image bytes are cleared (pass real PNG bytes to set them).
Console
Run a script to see console output here.
paged.batch([mutations])authorbool#

Apply an array of { op, args } mutation objects as ONE undoable step.

Apply an array of { op, args } mutations as ONE undoable step — here two text frames for a two-column page, created atomically.

Two-column layout in one undo step
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: Two side-by-side text columns appear in the open middle of the page, undoable as a single step.
Console
Run a script to see console output here.

Workflows

Real desktop-publishing tasks, each chaining several host functions into one recipe — a starting point you can edit and rerun.

paged.insertTextFrame(pageId, [t,l,b,r])authorstring (created id) | null#

Create an empty text-pourable frame at page-local point bounds (mints a story) and select it. Returns the new textFrame:<id> address, or null on failure.

Create a text frame, pour a heading + body, split it into two columns with a gutter, and style the heading — a complete article block.

Lay out a two-column article
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A two-column article with a distinct heading on the first line appears below the page header.
Console
Run a script to see console output here.
paged.insertTable(storyId, spec)authorstring | null#

Create a <Table> at the end of a story; spec = { rows, cols, headerRows?, footerRows?, columnWidths?, rowHeights? }. Returns the table id.

Mint a table, promote a repeating header band, pin the label column wide and the header row tall — a ready price list.

Build a 3-column price table
Open ↗paged.* · seed: styled-story
Loading editor…
Look for: A 3-column table with a tall repeating header and a wide first column.
Console
Run a script to see console output here.
paged.placeImage(frameId, uri, fit?)authorbool#

Place an image into a frame; fit is an optional fitting mode.

Draw a picture frame, place an image fitted proportionally, then add a small caption frame directly beneath it.

Place an image with a caption
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A fitted image above a small italic-sized caption line.
Console
Run a script to see console output here.
paged.linkFrames(fromId, toId)authorbool#

Thread fromId's overflow into the empty frame toId.

Pour a long story into a short frame, add a fresh page, and thread the overflow into a frame there — continuing the flow.

Thread overset copy onto a second page
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A story overflows page 1 and continues in a frame on page 2.
Console
Run a script to see console output here.
paged.set(id, path, value)writebool#

Set a property (see settablePaths) on the addressed element. null clears.

Turn the selected frame into a pull-quote: a 10% grey panel, a 2pt rule, generous inset, and enlarged 18pt type.

Style a pull-quote with a hairline rule
Open ↗paged.* · seed: one-text-frame-selected
Loading editor…
Look for: A tinted pull-quote panel with a 2pt rule and larger type.
Console
Run a script to see console output here.
paged.insertSection(pageId, {prefix?,style?,start?})authorbool#

Anchor a <Section> at a page.

Start the document in lower-roman front matter, add a page, then begin an arabic body section restarting at 1 — classic book folios.

Front-matter then body page numbering
Open ↗paged.* · seed: report-page
Loading editor…
Look for: Page 1 numbers as roman front matter; a later section restarts arabic at 1.
Console
Run a script to see console output here.
paged.insertField(storyId, offset, fieldKind)authorbool#

Insert a field marker; fieldKind = "pageNumber" | "nextPageNumber" | { placeholder: { plugin, key, value? } }.

Add a footer text frame, type a running head, and drop a live page-number field after it — the page folio.

Build a running footer with a folio
Open ↗paged.* · seed: starter-page
Loading editor…
Look for: A small footer line reading the running head followed by a live page number.
Console
Run a script to see console output here.
paged.insertGuide(spreadId, orientation, position, pageIndex?)authorbool#

Insert a ruler guide (orientation = vertical|horizontal).

Drop evenly-spaced vertical guides across the page to scaffold a multi-column grid before placing frames.

Set up a column grid with guides
Open ↗paged.* · seed: report-page
Loading editor…
Look for: Three vertical guides divide the content page into a column grid.
Console
Run a script to see console output here.

Looking for the full surface? See Host functions for every paged.* function and Settable paths for everything paged.set accepts.

On this page