Scripting (paged.*)
Host functions
Every paged.* host function available to scripts, grouped by kind — generated directly from the engine's scripting catalog.
ProIIIreference
In short The complete paged.* host surface, grouped by what each function
does. Generated from the engine catalog — if the engine adds a function, it
appears here automatically.
179 of 179 host functions, grouped by kind.
Read
| Function | Returns | Summary |
|---|---|---|
| paged.get(address, path) | value JSON | null | Read one property of any addressed object, as its wire value JSON (the read twin of paged.set; RequestGet on the wire). Text is read with path "text" (read-only): a story answers its paragraphs joined by \n, a text frame its story's (the whole thread), a storyRange its characters. A plugin: address asks the host's object registry: a Promise of the value's JSON (null when absent or mixed); a refusal rejects with .code. Try it ▸ |
| paged.inspect(id) | ElementProperties JSON | Full property snapshot for one element (or storyRange), or for a story (story:<id>: its text, then its story rows); null when the address names nothing. Try it ▸ |
| paged.tree() | SceneTreeNode[] JSON | Document hierarchy: spreads → pages → frames. Try it ▸ |
| paged.pages() | 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. Try it ▸ |
| paged.stories() | StorySummary[] JSON | Loaded stories with selfId + characterCount + paragraphCount. The source of valid story ids. Try it ▸ |
| paged.layers() | LayerSummary[] JSON | Document layers. Try it ▸ |
| paged.query(selector) | string[] JSON | Canonical addresses of every object a selector matches, document order (ADR 131): `page:#3 > frame`, `frame[name="price"]`, `[label.x-paged:oid=a1b2]`, `textFrame[style=Price]` (a style matches a page item's object style and, on a text frame or story, the paragraph and character styles its story applies), unions with `,`. Throws SyntaxError (with the offset) on a malformed selector. A selector naming plugin: kinds or objects is evaluated by the host's object registry and returns a Promise of the same JSON. |
| paged.schema(addressOrKind) | PropertySchema[] JSON | The typed property schema rows (ADR 132) of an address's kind (frame:u1, swatch:Color/Red) or a kind name (frame, page). A plugin: address or kind asks the host's object registry: a Promise of its PropertySchema[] JSON. |
| paged.commands(owner?) | Promise<CommandInfo[] JSON> | The typed commands the host's object registry offers (core's first), optionally of one owner ("core" or a plugin id): a Promise of the CommandInfo[] JSON. With no host it throws code noHost. |
| paged.address(id) | string|null | Canonical address of an object, from any accepted spelling (`frame:u1`, `page:#2`, a style by name) or a {kind,id} element; null when nothing answers to it. |
| paged.swatches() | SwatchSummary[] JSON | Colour palette (selfId/name/kind). Try it ▸ |
| paged.paragraphStyles() | ParagraphStyleSummary[] JSON | Paragraph styles — the source of valid styleRefs for applyStyle. Try it ▸ |
| paged.characterStyles() | CharacterStyleSummary[] JSON | Character styles. Try it ▸ |
| paged.objectStyles() | ObjectStyleSummary[] JSON | Object styles. Try it ▸ |
| paged.gradients() | GradientSummary[] JSON | Gradients. Try it ▸ |
| paged.colorGroups() | ColorGroupSummary[] JSON | Colour groups. Try it ▸ |
| paged.links() | LinkSummary[] JSON | Placed-asset links. Try it ▸ |
| paged.conditions() | ConditionSummary[] JSON | Conditional-text conditions. Try it ▸ |
| paged.conditionSets() | ConditionSetSummary[] JSON | Condition sets. Try it ▸ |
| paged.collection(name) | Summary[] JSON | Generic typed-collection read by name; unknown name → "[]" + warning. Try it ▸ |
| paged.documentMeta() | DocumentMeta JSON | Document metadata (name/creator/modified/page count). Try it ▸ |
| paged.selection() | ElementId[] JSON | Current element selection. Try it ▸ |
| paged.contentSelection() | ContentSelection JSON | null | Current text caret / range. Try it ▸ |
| paged.planarRegions([id, ...], [x, y]?) | PlanarRegionsResult JSON | The planar arrangement of the named paths: found, faces (each with an id), inputCount, complete, reason. With a point, only the face under it. This is how a script names a face for pathfinderFaces. |
Write
| Function | Returns | Summary |
|---|---|---|
| paged.set(address, path, value) | bool | Set one property of any object (Mutation::Set). address is an idGrammar address — an element (rectangle:u12, storyRange:Story/u1@0..6), doc, page:#2, layer:<id>, swatch:Color/Red, style:object/<id>, cell:<table>/0,1, textVariable:<id>, … — and path any row propertySchemas lists for that kind (settablePaths on elements). The value is coerced by the path's schema (enum members, ranges, "3mm" on a length). null clears. A selector is not a target: paged.query it first. The protocol-70 target object ({kind:"layer",layerId}) is still accepted, deprecated. A plugin:<pluginId>/<kind>/<id> address goes to the host's object registry (ADR 323): it returns a Promise<true>, consecutive plugin sets fold into ONE batched host round trip, a refusal rejects with an Error whose .code is the registry's code (an unawaited refusal fails the script), and core + plugin writes of one script undo as one step. With no host registry it throws code noHost. Try it ▸ |
| paged.invoke(id, args?) | Promise<command result JSON> | Run a typed command — core.<op> (every catalog operation, args as the op's typed struct; id positions take addresses) or a plugin's — through the host's object registry (RequestHostObjects invoke): a Promise of its result JSON ({ created, undoSteps } for a core command). Commands live in the host's registry only: with no host it throws code noHost; a refusal rejects with .code. Inside paged.batch use { op: "invoke", id, args, handle? }. |
| paged.resizePage(pageId, [t,l,b,r]) | bool | Set a page's GeometricBounds in page-inner points. Try it ▸ |
| paged.applyMasterToPage(pageId, masterId?) | bool | Apply a master to a page (omit/null detaches). Try it ▸ |
| paged.movePage(pageId, afterPageId?) | bool | Move a page to follow another (omit/null: to the front). |
| paged.renameMaster(masterId, name?) | bool | Set (omit/null: clear) a master's name. |
| paged.onMaster(masterId, mutation) | bool | Apply a mutation ({ op, args }) to a master spread's items. |
| paged.setPageMetadata(pageId, key, value?) | bool | Set or delete one plugin-metadata entry on a page (value: the JSON envelope). |
| paged.moveFrame(frameId, [a,b,c,d,tx,ty]) | bool | Set a frame's affine placement transform. Try it ▸ |
| paged.resizeFrame(frameId, [t,l,b,r]) | bool | Set a frame's content-box bounds (re-paginating resize). Try it ▸ |
| paged.pathPointCurveType(elemId, index, smooth) | bool | Toggle an anchor between corner and smooth. Try it ▸ |
| paged.pathPointSet(elemId, index, role, [x,y]) | bool | Write one Bezier handle (role = anchor|left|right). Try it ▸ |
| paged.pathOpenAt(elemId, index) | bool | Cut the path at the anchor at flat index. Try it ▸ |
| paged.outlineStroke(elemId, width, cap, join, miter) | bool | Replace the path with its stroke-expansion outline. Try it ▸ |
| paged.offsetPath(elemId, delta, join, miter) | bool | Inset (delta<0) / outset (delta>0) a single closed contour. Try it ▸ |
| paged.simplifyPath(elemId, tolerance) | bool | Re-express the path with fewer anchors within tolerance pt. Try it ▸ |
| paged.setFieldValue(storyId, offset, value?) | bool | Update a placeholder field's cached display value (null ⇒ unresolved). Try it ▸ |
| paged.replaceImageBytes(frameId, bytes?) | bool | Commit inline image bytes (number[] of u8) on a graphic frame; null clears. Try it ▸ |
| paged.setRowHeight(storyId, tableId, row, height?) | bool | Set/clear a table row height in pt. Try it ▸ |
| paged.setColumnWidth(storyId, tableId, col, width?) | bool | Set/clear a table column width in pt. Try it ▸ |
| paged.setCellSpan(storyId, tableId, row, col, rowSpan, columnSpan) | bool | Set a cell's row/column span. Try it ▸ |
| paged.renameParagraphStyle(styleId, name) | bool | Rename a paragraph style. Try it ▸ |
| paged.renameCharacterStyle(styleId, name) | bool | Rename a character style. Try it ▸ |
| paged.renameObjectStyle(styleId, name) | bool | Rename an object style. Try it ▸ |
| paged.renameCellStyle(styleId, name) | bool | Rename a cell style. Try it ▸ |
| paged.renameTableStyle(styleId, name) | bool | Rename a table style. Try it ▸ |
| paged.setStyleProperty(collection, styleId, path, value) | bool | Set one property on a style definition (collection = paragraph|character|object|cell|table; path = a settablePaths name). Try it ▸ |
| paged.editNumberingList(listId, spec) | bool | Edit a <NumberingList>. Try it ▸ |
| paged.editSection(sectionId, {prefix?,style?,start?}) | bool | Edit a <Section>; prefix/start are tri-state (omit ⇒ leave, null ⇒ clear). Try it ▸ |
| paged.setConditionVisible(conditionId, visible) | bool | Flip a condition's visibility. Try it ▸ |
| paged.setFlowGrowRule(storyId, grow, maxPages?, copyFrameOptions?) | bool | Let a story's frame chain grow: generated pages are added after its last frame's page while it oversets (InDesign's Smart Text Reflow), and removed when empty. copyFrameOptions gives generated frames the chain's frame options (a Word section's mode) instead of InDesign's defaults. grow=false clears the rule. |
| paged.activateConditionSet(setId) | bool | Activate one <ConditionSet> ("show only this set"). Try it ▸ |
| paged.layerMove(layerId, newIndex) | bool | Reorder a layer to a new zero-based index. Try it ▸ |
| paged.moveGuide(guideId, position) | bool | Move a guide along its perpendicular axis. Try it ▸ |
| paged.setDocumentDefaults({fill?,stroke?,weight?}) | bool | Set the new-object fill/stroke/weight defaults (whole-triple). Try it ▸ |
| paged.setColorSettings({cmykProfileName?,rgbPolicy?,intent?,bpc?}) | bool | Replace the document colour-management settings. Try it ▸ |
| paged.setProofSetup({profileName?,simulatePaperWhite?,intent?}) | bool | Soft-proofing configuration (profileName null turns proofing off). Try it ▸ |
| paged.setInkSetting(spotId, {convertToProcess?,aliasTo?}) | bool | Replace one ink's output-time settings. Try it ▸ |
| paged.setUseStandardLabForSpots(enabled) | bool | Prefer spots' Lab primary over their CMYK alternate in previews. Try it ▸ |
| paged.setPluginMetadata(elemId, key, value?, caller?) | bool | Write one Label key/value pair on a leaf page item (value null deletes). Try it ▸ |
| paged.setDocumentMetadata(key, value?, caller?) | bool | Write one document-scoped Label key/value pair (value null deletes); undoable. |
| paged.setElementSelection([id, ...]) | bool | Replace the element selection with the parseable ids. Try it ▸ |
| paged.clearSelection() | bool | Clear the element selection. Try it ▸ |
| paged.setContentSelection({storyId,start,end} | null) | bool | Set or clear the text caret/range. Try it ▸ |
| paged.layerSetVisible(layerId, visible) | bool | Show or hide a layer. |
| paged.layerSetLocked(layerId, locked) | bool | Lock or unlock a layer. |
| paged.layerSetPrintable(layerId, printable) | bool | Include a layer in output, or hold it back. |
| paged.layerSetName(layerId, name) | bool | Rename a layer. |
Author (structural)
| Function | Returns | Summary |
|---|---|---|
| paged.insertText(storyId, offset, text) | bool | Insert plain text at a story body offset; \n splits paragraphs. Try it ▸ |
| paged.deleteRange(storyId, start, end) | bool | Delete the [start, end) character range of a story. Try it ▸ |
| paged.insertTextFrame(pageId, [t,l,b,r]) | 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. Try it ▸ |
| paged.insertFrame(pageId, [t,l,b,r]) | 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. Try it ▸ |
| paged.insertPage(afterPageId?) | 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. Try it ▸ |
| paged.placeImage(frameId, uri, fit?) | bool | Place an image into a frame; fit is an optional fitting mode. Try it ▸ |
| paged.applyStyle(storyId, start, end, styleRef) | bool | Apply a paragraph/character style to a story range. Scope inferred from the ref prefix (CharacterStyle/… else Paragraph). Try it ▸ |
| paged.createGroup([id, ...]) | bool | Group two-or-more elements; <2 valid members returns false. Try it ▸ |
| paged.duplicateElements([id, ...], dx, dy) | string[] (created ids) JSON | null | Duplicate page items: a whole clone of each (properties, plugin metadata, group members, pasted-in children, a text frame's story), offset by (dx, dy) pt and inserted directly above its source, in one undo step. Selects the clones and returns their kind:id addresses in source order; null when the engine refuses (threaded text frame, anchored object, opacity mask, an element named together with its group). |
| paged.deletePage(pageId) | bool | Delete a page. Try it ▸ |
| paged.duplicatePage(pageId) | string | null | Duplicate a single-page spread after the source — its items, a copy of each frame's story, its margins; returns the new page selfId. Try it ▸ |
| paged.createMaster(masterId, { name?, widthPt?, heightPt?, duplicateOf? }) | bool | Create a master spread: one page of the given size, or a copy of another master. |
| paged.deleteMaster(masterId) | bool | Delete a master no page applies. |
| paged.deleteElement(id) | bool | Delete a page item (kind:id address or bare self id). Try it ▸ |
| paged.dissolveGroup(groupId) | bool | Ungroup; members return to the group's paint slot. Try it ▸ |
| paged.linkFrames(fromId, toId) | bool | Thread fromId's overflow into the empty frame toId. Try it ▸ |
| paged.unlinkFrames(frameId) | bool | Break the text thread leaving a frame. Try it ▸ |
| paged.insertLine(pageId, [x1,y1], [x2,y2]) | string | null | Insert a two-anchor open GraphicLine. Try it ▸ |
| paged.insertOval(pageId, [t,l,b,r]) | string | null | Insert an Oval. Try it ▸ |
| paged.insertPath(pageId, anchors, open, smooth?) | string | null | Insert an arbitrary path; anchors = [{anchor:[x,y],left:[x,y],right:[x,y]}, …]. Try it ▸ |
| paged.pathPointInsert(elemId, index, anchor, subpathStarts?) | bool | Insert an anchor into a path's flat PathPointArray at index. Try it ▸ |
| paged.pathPointRemove(elemId, index) | bool | Remove the anchor at flat index. Try it ▸ |
| paged.pathfinderBoolean(keptId, [otherIds], kind) | bool | Pathfinder boolean (kind = union|intersect|subtract|exclude). Try it ▸ |
| paged.insertField(storyId, offset, fieldKind) | bool | Insert a field marker; fieldKind = "pageNumber" | "nextPageNumber" | { placeholder: { plugin, key, value? } } | { textVariable: { variableId } } (an instance of a text variable; InDesign keeps it). Try it ▸ |
| paged.createTextVariable(name, contents?, textBefore?, textAfter?) | string (address) | null | Define a custom text variable; returns textVariable:dTextVariablen<name>. Switch its value with paged.set(address, "textVariableContents", v) — every instance re-bakes. |
| paged.deleteTextVariable(variableId) | bool | Remove a text variable definition (refused while an instance is in the text). |
| paged.insertTable(storyId, spec) | string | null | Create a <Table> at the end of a story; spec = { rows, cols, headerRows?, footerRows?, columnWidths?, rowHeights? }. Returns the table id. Try it ▸ |
| paged.insertTableRow(storyId, tableId, at) | bool | Insert an empty body row at index. Try it ▸ |
| paged.deleteTable(storyId, tableId) | bool | Delete a whole table and its host paragraph; undo restores every cell. |
| paged.deleteTableRow(storyId, tableId, at) | bool | Delete the body row at index. Try it ▸ |
| paged.insertTableColumn(storyId, tableId, at) | bool | Insert an empty column at index. Try it ▸ |
| paged.deleteTableColumn(storyId, tableId, at) | bool | Delete the column at index. Try it ▸ |
| paged.insertHeaderRow(storyId, tableId) | bool | Insert a header-band row. Try it ▸ |
| paged.removeHeaderRow(storyId, tableId) | bool | Remove the first header row. Try it ▸ |
| paged.insertFooterRow(storyId, tableId) | bool | Insert a footer-band row. Try it ▸ |
| paged.removeFooterRow(storyId, tableId) | bool | Remove the last footer row. Try it ▸ |
| paged.createParagraphStyle({id?,name?,basedOn?}) | string | null | Create a paragraph style; returns its selfId. Try it ▸ |
| paged.deleteParagraphStyle(styleId) | bool | Delete a paragraph style. Try it ▸ |
| paged.createCharacterStyle({id?,name?,basedOn?}) | string | null | Create a character style; returns its selfId. Try it ▸ |
| paged.deleteCharacterStyle(styleId) | bool | Delete a character style. Try it ▸ |
| paged.createObjectStyle({id?,name?,basedOn?}) | string | null | Create an object style; returns its selfId. Try it ▸ |
| paged.deleteObjectStyle(styleId) | bool | Delete an object style. Try it ▸ |
| paged.createCellStyle({id?,name?,basedOn?}) | string | null | Create a cell style; returns its selfId. Try it ▸ |
| paged.deleteCellStyle(styleId) | bool | Delete a cell style. Try it ▸ |
| paged.createTableStyle({id?,name?,basedOn?}) | string | null | Create a table style; returns its selfId. Try it ▸ |
| paged.deleteTableStyle(styleId) | bool | Delete a table style. Try it ▸ |
| paged.createNumberingList(spec) | string | null | Create a <NumberingList>; returns its id. Try it ▸ |
| paged.deleteNumberingList(listId) | bool | Delete a <NumberingList>. Try it ▸ |
| paged.insertSection(pageId, {prefix?,style?,start?}) | bool | Anchor a <Section> at a page. Try it ▸ |
| paged.deleteSection(sectionId) | bool | Delete a <Section>. Try it ▸ |
| paged.layerInsert(position, name) | bool | Append a layer at the zero-based stacking index. Try it ▸ |
| paged.layerRemove(layerId) | bool | Remove a layer. Try it ▸ |
| paged.insertGuide(spreadId, orientation, position, pageIndex?) | bool | Insert a ruler guide (orientation = vertical|horizontal). Try it ▸ |
| paged.deleteGuide(guideId) | bool | Delete a guide. Try it ▸ |
| paged.importSwatchLibrary(bytes, groupName?) | bool | Import an .ase swatch library (bytes = number[]) as one undoable op. Try it ▸ |
| paged.batch([mutations] | [objectOps]) | bool | per-op results JSON | Apply an array of { op, args } mutation objects as ONE undoable step (bool). An array of ADR 323 object ops ({ op: "set", address, path, value }) returns the per-op results JSON ([{ ok } | { ok: false, code, reason }]), all-or-nothing in ONE undo step; when any op names a plugin: address, or is a typed command ({ op: "invoke", id, args, handle? }), the whole batch goes to the host's object registry (a Promise of the same JSON), so a command shares the one undo step with the sets. Try it ▸ |
| paged.reorderElement(id, target) | bool | Raise or lower an element in its parent's z-order. target = front | back | forward | backward | {index: n} (n = the final slot, 0 = backmost). |
| paged.pasteInto(containerId, childId) | bool | Nest an existing item inside a container frame. |
| paged.releaseFrom(childId) | bool | Lift a nested item back out of its container (inverse of pasteInto). |
| paged.closePath(id, subpath?) | bool | Close an open contour; subpath defaults to the whole path. |
| paged.joinPaths(id, otherId) | bool | Weld two open paths into one. |
| paged.pathfinderDivide([id, ...]) | bool | Divide the selection into its planar regions. |
| paged.pathfinderTrim([id, ...]) | bool | Trim hidden parts of the lower shapes away. |
| paged.pathfinderMerge([id, ...]) | bool | Merge adjacent same-paint regions of the selection. |
| paged.pathfinderCrop([id, ...]) | bool | Crop the selection to the topmost shape. |
| paged.pathfinderOutline([id, ...]) | bool | Reduce the selection to its outlined edges. |
| paged.pathfinderMinusBack([id, ...]) | bool | Subtract the shapes behind from the frontmost one. |
| paged.pathfinderFaces([id, ...], [faceId, ...], mode) | bool | Build ONE element from faces of the planar arrangement, united: mode keep = the named faces, remove = every other face (none named: every face, so the inputs unite). The result goes onto the topmost input covering a selected face; every other input is removed, so faces outside the selection are not kept. Face ids come from paged.planarRegions. |
| paged.applyOpacityMask(targetId, maskId, {maskType?, invert?}?) | bool | Mask one element with another. |
| paged.releaseOpacityMask(targetId) | bool | Remove an element's opacity mask. |
| paged.attachTextToPath(id, storyId, {pathTypeAlignment?, flipPathEffect?, startBracket?, endBracket?}?) | bool | Run a story along a path. |
| paged.detachTextFromPath(id) | bool | Take a story back off its path. |
| paged.insertAnchoredFrame(storyId, offset, width, height, imageUri?) | bool | Anchor a frame in the text at a story offset; with imageUri the frame is created holding that image. |
| paged.insertHyperlink(storyId, start, end, url, pageId?) | bool | Make a character range a clickable link. Read the result with paged.collection("hyperlinks") — paged.links() is the placed-asset list, not this. |
| paged.deleteHyperlink(hyperlinkId) | bool | Delete a hyperlink (any origin) by its id from paged.collection("hyperlinks"): its text stops linking, and its URL or page destination goes when nothing else uses it. |
| paged.editHyperlink(hyperlinkId, { name?, url?, pageId? }) | bool | Rename a hyperlink or send it to a new URL or page (pageId wins); an empty name clears it. |
| paged.updateTableOfContents(storyId) | bool | Update Table of Contents: rewrite a TOC story (one bound to a TOC style) from its style over the current layout — the title, then one paragraph per heading with its page number. Until then it prints the text it holds. |
| paged.generateIndex(storyId) | bool | Generate Index: write the document's index into a story (replacing its text) from its topics and page references over the current layout — the title, a heading per letter, each topic with its pages and See references. Index styles the document lacks are created. |
| paged.updateCrossReferences(sourceId?) | bool | Update Cross-References: rewrite a cross-reference's text (every one's without an id) from its format and its destination paragraph; the page number is always live. |
| paged.insertFootnote(storyId, offset, text) | string|null | Insert a footnote at a story offset: its reference there, and the note (its number, the separator, then text). Returns the note's id; read the notes with paged.collection("footnotes"). |
| paged.deleteFootnote(storyId, footnoteId) | bool | Delete a footnote: its reference and its note. Undo puts both back as they were. |
| paged.insertNote(storyId, offset, text, user?, date?) | string|null | Insert an editorial note at a story offset: its place there (one character that prints nothing) and its text, paragraphs separated by \r; user and date are what it records as its author and dates. Returns the note's id; read the notes with paged.collection("notes"). |
| paged.editNote(noteId, text, date?) | bool | Rewrite an editorial note's text; date becomes its modification date. |
| paged.deleteNote(noteId) | bool | Delete an editorial note and its place in the text. Undo puts it back as it was. |
| paged.convertNoteToText(noteId) | bool | Convert to Text: an editorial note's place becomes a space and the note's text, its paragraphs the story's. |
| paged.createBookmark(name, {page?, destination?, parent?, index?}) | string|null | New Bookmark: to a page (through a page destination of its own) or an existing destination, under a bookmark or at the top level, at an index among its siblings. Returns the bookmark's id; read them with paged.collection("bookmarks"). |
| paged.deleteBookmark(bookmarkId) | bool | Delete a bookmark and the bookmarks under it, and the page destinations nothing else goes to. Undo puts them back. |
| paged.renameBookmark(bookmarkId, name) | bool | Rename a bookmark. |
| paged.insertEndnote(storyId, offset, text) | string|null | Insert an endnote at a story offset: its reference there and its range in the endnote story, after the note before it, as InDesign writes one. The first endnote makes the endnote story on a page of its own. Returns the endnote's id; read them with paged.collection("endnotes"). |
| paged.deleteEndnote(endnoteId) | bool | Delete an endnote: its reference and its range. Undo puts both back as they were. |
| paged.convertFootnoteToEndnote(storyId, footnoteId) | string|null | Convert a footnote to an endnote: the footnote goes and an endnote of its text takes its reference's place. Returns the endnote's id. |
| paged.moveBookmark(bookmarkId, parentId?, index?) | bool | Move a bookmark with the bookmarks under it: under another bookmark (the top level for null), at an index among its siblings. |
| paged.createSwatch(spec) | string (created id) | null | Create a swatch from a SwatchSpec ({space, value: [...], name?, model?, tint?}); returns its selfId. |
| paged.editSwatch(swatchId, spec) | bool | Replace a swatch's definition. |
| paged.deleteSwatch(swatchId) | bool | Delete a swatch. |
| paged.createGradient(spec) | string (created id) | null | Create a gradient from a GradientSpec ({kind: "Linear"|"Radial", stops: [...], name?}); returns its selfId. |
| paged.editGradient(gradientId, spec) | bool | Replace a gradient's definition. |
| paged.deleteGradient(gradientId) | bool | Delete a gradient. |
| paged.createColorGroup(spec) | string (created id) | null | Create a colour group from a ColorGroupSpec; returns its selfId. |
| paged.editColorGroup(groupId, spec) | bool | Replace a colour group's definition. |
| paged.deleteColorGroup(groupId) | bool | Delete a colour group. |
History (undo/redo)
Console
| Function | Returns | Summary |
|---|---|---|
| console.log(...) | undefined | Append a line to the captured output log. |
| console.warn(...) | undefined | Append a warn-level line to the captured output log. |
| console.error(...) | undefined | Append an error-level line to the captured output log. |
| console.info(...) | undefined | Append an info-level line to the captured output log. |
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.
Settable paths & id grammar
The property paths accepted by paged.set, and the id grammar for addressing elements — generated from the engine's scripting catalog.