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: Intermediate Intermediate II · how-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).
paged.tree() read → SceneTreeNode[] JSON# Document hierarchy: spreads → pages → frames.
spreads → pages → frames. Page/spread ids are null by design; frames carry real ids.
Walk the document hierarchy ▶ Load & run Reset Copy Open ↗ paged.* · seed: article-spread ▶ Load the editor the real Paged editor, driven by your script
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() read → PageSummary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
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) read → ElementProperties 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
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) read → value | null# Read one property value of the addressed element.
paged.get reads one property without the full inspect payload.
Read a single property value ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
Look for: The console prints the frame’s bounds [top, left, bottom, right].
Console
Run a script to see console output here.
paged.set(id, path, value) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
Look for: The flyer headline turns red and rotates 12°.
Console
Run a script to see console output here.
paged.insertTextFrame(pageId, [t,l,b,r]) author → string (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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
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) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
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?) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: image-frame ▶ Load the editor the real Paged editor, driven by your script
Look for: The graphic frame fills with the placed image.
Console
Run a script to see console output here.
paged.undo() history → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
Look for: The headline turns red, then undo reverts it, then redo re-applies it.
Console
Run a script to see console output here.
paged.deleteElement(id) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: two-frames ▶ Load the editor the real Paged editor, driven by your script
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]) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
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]) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
Look for: The frame grows to fill more of the page.
Console
Run a script to see console output here.
paged.duplicatePage(pageId) author → string | 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
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, ...]) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: catalog ▶ Load the editor the real Paged editor, driven by your script
Look for: All six product tiles on the page become selected.
Console
Run a script to see console output here.
paged.dissolveGroup(groupId) author → bool# Ungroup; members return to the group's paint slot.
createGroup bundles two elements; dissolveGroup returns the members to the page.
Group, then ungroup ▶ Load & run Reset Copy Open ↗ paged.* · seed: two-frames ▶ Load the editor the real Paged editor, driven by your script
Look for: The two frames are grouped, then ungrouped again (watch the selection bounds).
Console
Run a script to see console output here.
paged.insertOval(pageId, [t,l,b,r]) author → string | null# Insert an Oval.
A graphic primitive — like insertLine / insertFrame, it returns the new element id.
Draw an oval ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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]) author → string | null# Insert a two-anchor open GraphicLine.
A graphic line between two page-local points.
Draw a line ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
Look for: A diagonal line is drawn across the open middle of the page.
Console
Run a script to see console output here.
paged.createParagraphStyle({id?,name?,basedOn?}) author → string | 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
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) author → string | 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A 3×3 table appears at the start of the story.
Console
Run a script to see console output here.
Every read returns a JSON string — parse it, then report a count or the first row.
paged.swatches() read → SwatchSummary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: swatches-and-styles ▶ Load the editor the real Paged editor, driven by your script
Look for: The console prints each swatch name and kind (process, spot, …).
Console
Run a script to see console output here.
paged.gradients() read → GradientSummary[] JSON# Gradients.
Gradient swatches (linear / radial ramps) the document defines. A fresh document ships none until you add them.
List the document gradients ▶ Load & run Reset Copy Open ↗ paged.* · seed: swatches-and-styles ▶ Load the editor the real Paged editor, driven by your script
Look for: The console reports the gradient count (0 on a blank palette).
Console
Run a script to see console output here.
paged.colorGroups() read → ColorGroupSummary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: swatches-and-styles ▶ Load the editor the real Paged editor, driven by your script
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() read → LayerSummary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
Look for: The console prints a Background → Artwork layer stack, bottom to top.
Console
Run a script to see console output here.
paged.paragraphStyles() read → ParagraphStyleSummary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The console prints every paragraph style and its BasedOn parent.
Console
Run a script to see console output here.
paged.characterStyles() read → CharacterStyleSummary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The console prints the character stylesheet.
Console
Run a script to see console output here.
paged.objectStyles() read → ObjectStyleSummary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: swatches-and-styles ▶ Load the editor the real Paged editor, driven by your script
Look for: The console reports the object-style count.
Console
Run a script to see console output here.
paged.links() read → LinkSummary[] JSON# Placed-asset links.
Place an image, then read the Links collection — each row reports the host frame, the asset URI and whether it resolved (a preflight check).
Audit placed-image links ▶ Load & run Reset Copy Open ↗ paged.* · seed: image-frame ▶ Load the editor the real Paged editor, driven by your script
Look for: The console lists one placed-image link with its URI and status.
Console
Run a script to see console output here.
paged.conditions() read → ConditionSummary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
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() read → ConditionSetSummary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
Look for: The console reports the condition-set count.
Console
Run a script to see console output here.
paged.collection(name) read → Summary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: catalog ▶ Load the editor the real Paged editor, driven by your script
Look for: The console prints each spread and its page count.
Console
Run a script to see console output here.
paged.documentMeta() read → DocumentMeta 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
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() read → StorySummary[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: article-spread ▶ Load the editor the real Paged editor, driven by your script
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() read → ElementId[] 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
Look for: The console prints the selected frame address.
Console
Run a script to see console output here.
paged.contentSelection() read → ContentSelection 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
Look for: The console reports a 5-character text range.
Console
Run a script to see console output here.
paged.clearSelection() write → bool# Clear the element selection.
Drop the element selection — e.g. to dismiss handles before exporting a clean preview.
Deselect everything ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
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) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The first heading word is highlighted as a text range.
Console
Run a script to see console output here.
paged.insertPage(afterPageId?) author → string (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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
Look for: The document grows from 1 to 2 pages.
Console
Run a script to see console output here.
paged.deletePage(pageId) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
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]) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
Look for: The content page becomes narrower and taller (A4 proportions).
Console
Run a script to see console output here.
paged.applyMasterToPage(pageId, masterId?) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
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.
paged.insertFrame(pageId, [t,l,b,r]) author → string (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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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, ...]) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: two-frames ▶ Load the editor the real Paged editor, driven by your script
Look for: The two frames become a single selectable group.
Console
Run a script to see console output here.
paged.linkFrames(fromId, toId) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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.
paged.insertPath(pageId, anchors, open, smooth?) author → string | 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) ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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?) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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]) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) write → bool# 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) ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
Look for: The shape contracts by 10pt all round.
Console
Run a script to see console output here.
paged.simplifyPath(elemId, tolerance) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
Look for: Two overlapping squares merge into a single union outline.
Console
Run a script to see console output here.
paged.insertTableRow(storyId, tableId, at) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A four-row table gains a fifth row.
Console
Run a script to see console output here.
paged.deleteTableRow(storyId, tableId, at) author → bool# Delete the body row at index.
Remove a body row by index — pruning a discontinued line item.
Delete a table row ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A four-row table drops to three rows.
Console
Run a script to see console output here.
paged.insertTableColumn(storyId, tableId, at) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A three-column table gains a fourth column.
Console
Run a script to see console output here.
paged.deleteTableColumn(storyId, tableId, at) author → bool# Delete the column at index.
Remove a column by index — dropping a column the layout no longer needs.
Delete a table column ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A three-column table drops to two columns.
Console
Run a script to see console output here.
paged.setCellSpan(storyId, tableId, row, col, rowSpan, columnSpan) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
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?) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
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?) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The first column becomes a fixed 140pt wide.
Console
Run a script to see console output here.
paged.createCharacterStyle({id?,name?,basedOn?}) author → string | 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
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) write → bool# Rename a character style.
Create a style, then give it a clearer display name.
Rename a character style ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The style is renamed from Emph to Emphasis.
Console
Run a script to see console output here.
paged.deleteCharacterStyle(styleId) author → bool# Delete a character style.
Clean up the stylesheet by removing a style you no longer need.
Delete an unused character style ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A just-created character style is removed again.
Console
Run a script to see console output here.
paged.createObjectStyle({id?,name?,basedOn?}) author → string | 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: swatches-and-styles ▶ Load the editor the real Paged editor, driven by your script
Look for: A new Photo Frame object style is added.
Console
Run a script to see console output here.
paged.renameObjectStyle(styleId, name) write → bool# Rename an object style.
Create an object style and rename it.
Rename an object style ▶ Load & run Reset Copy Open ↗ paged.* · seed: swatches-and-styles ▶ Load the editor the real Paged editor, driven by your script
Look for: The object style is renamed.
Console
Run a script to see console output here.
paged.deleteObjectStyle(styleId) author → bool# Delete an object style.
Remove an object style from the document.
Delete an object style ▶ Load & run Reset Copy Open ↗ paged.* · seed: swatches-and-styles ▶ Load the editor the real Paged editor, driven by your script
Look for: A just-created object style is removed.
Console
Run a script to see console output here.
paged.createCellStyle({id?,name?,basedOn?}) author → string | 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A new Header Cell style is added.
Console
Run a script to see console output here.
paged.renameCellStyle(styleId, name) write → bool# Rename a cell style.
Create a cell style and rename it.
Rename a cell style ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The cell style is renamed.
Console
Run a script to see console output here.
paged.deleteCellStyle(styleId) author → bool# Delete a cell style.
Remove a cell style from the document.
Delete a cell style ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A just-created cell style is removed.
Console
Run a script to see console output here.
paged.createTableStyle({id?,name?,basedOn?}) author → string | 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A new Price List table style is added.
Console
Run a script to see console output here.
paged.renameTableStyle(styleId, name) write → bool# Rename a table style.
Create a table style and rename it.
Rename a table style ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The table style is renamed.
Console
Run a script to see console output here.
paged.deleteTableStyle(styleId) author → bool# Delete a table style.
Remove a table style from the document.
Delete a table style ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A just-created table style is removed.
Console
Run a script to see console output here.
paged.renameParagraphStyle(styleId, name) write → bool# Rename a paragraph style.
Create a paragraph style and give it a production-ready name.
Rename a paragraph style ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The Body style is renamed to Body Text.
Console
Run a script to see console output here.
paged.deleteParagraphStyle(styleId) author → bool# Delete a paragraph style.
Remove a paragraph style from the stylesheet.
Delete a paragraph style ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A just-created paragraph style is removed.
Console
Run a script to see console output here.
paged.setStyleProperty(collection, styleId, path, value) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The Body style is set to 10pt with 4pt space-after.
Console
Run a script to see console output here.
paged.createNumberingList(spec) author → string | 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A new Steps numbering list is defined.
Console
Run a script to see console output here.
paged.editNumberingList(listId, spec) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The list is set to continue numbering across stories.
Console
Run a script to see console output here.
paged.deleteNumberingList(listId) author → bool# Delete a <NumberingList>.
Remove a numbered-list resource from the document.
Delete a numbering list ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: A just-created numbering list is removed.
Console
Run a script to see console output here.
paged.insertSection(pageId, {prefix?,style?,start?}) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
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?}) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
Look for: The section gains an A- page-number prefix.
Console
Run a script to see console output here.
paged.deleteSection(sectionId) author → bool# Delete a <Section>.
Remove a section so its page-numbering restart reverts to the previous scheme.
Delete a section ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
Look for: A just-created section is removed.
Console
Run a script to see console output here.
paged.setConditionVisible(conditionId, visible) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
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) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
Look for: The first condition set activates (or reports false when none exist).
Console
Run a script to see console output here.
paged.layerInsert(position, name) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
Look for: An Annotations layer is added to the stack.
Console
Run a script to see console output here.
paged.layerMove(layerId, newIndex) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
Look for: The Background layer moves to the bottom of the stack.
Console
Run a script to see console output here.
paged.layerRemove(layerId) author → bool# Remove a layer.
Delete a layer by id — tidying up an empty scratch layer.
Remove an empty layer ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
Look for: A just-added layer is removed again.
Console
Run a script to see console output here.
paged.insertGuide(spreadId, orientation, position, pageIndex?) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
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) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
Look for: The guide slides from 144pt to 216pt.
Console
Run a script to see console output here.
paged.deleteGuide(guideId) author → bool# Delete a guide.
Remove a guide by its minted id (read from the spread guides list).
Delete a ruler guide ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
Look for: A just-added guide is removed.
Console
Run a script to see console output here.
paged.insertField(storyId, offset, fieldKind) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
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?) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
Look for: A SKU placeholder is inserted then resolved to a value.
Console
Run a script to see console output here.
paged.deleteRange(storyId, start, end) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
Look for: The first word (the heading) is deleted from the story.
Console
Run a script to see console output here.
paged.redo() history → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
Look for: The headline turns red, undo reverts it, redo re-applies the red fill.
Console
Run a script to see console output here.
paged.setDocumentDefaults({fill?,stroke?,weight?}) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
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?}) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
Look for: The document colour-management settings are updated.
Console
Run a script to see console output here.
paged.setProofSetup({profileName?,simulatePaperWhite?,intent?}) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
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?}) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
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) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: flyer ▶ Load the editor the real Paged editor, driven by your script
Look for: Spot-colour previews switch to their Lab values.
Console
Run a script to see console output here.
paged.importSwatchLibrary(bytes, groupName?) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: swatches-and-styles ▶ Load the editor the real Paged editor, driven by your script
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?) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: image-frame ▶ Load the editor the real Paged editor, driven by your script
Look for: The selected frame carries an x-paged:review label.
Console
Run a script to see console output here.
paged.replaceImageBytes(frameId, bytes?) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: image-frame ▶ Load the editor the real Paged editor, driven by your script
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]) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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.
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]) author → string (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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) author → string | 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: styled-story ▶ Load the editor the real Paged editor, driven by your script
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?) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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) write → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: one-text-frame-selected ▶ Load the editor the real Paged editor, driven by your script
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?}) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
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) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: starter-page ▶ Load the editor the real Paged editor, driven by your script
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?) author → bool# 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 ▶ Load & run Reset Copy Open ↗ paged.* · seed: report-page ▶ Load the editor the real Paged editor, driven by your script
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.