Paged Docs / Module commands
paged.draw commands
paged.draw's typed commands — path operations, recipes, the Knife, Shape Builder and other tools as data, Liquify, Puppet Warp, the perspective grid, width profiles.
Reviewed against engine v0.77.0
Every drawing operation the menus offer, as a command with its arguments.
In short Nearly every command of paged.draw has
a typed twin with the same id, media.paged.draw.command.<name> (the few left over
only open a panel). A command acts on its targets — it selects them first
and runs the menu's own code — and is one undo step. Lengths are numbers in points;
points on the page are [x, y] in page points.
How to call them: Module commands.
The tools as data
The Knife, Scissors, Shape Builder and the scrub tools were tools only; their gesture is now an argument, so a script or the command line can cut.
| Command | Arguments | What it does |
|---|---|---|
knife | targets, page, cut: [[x, y], …] | Cuts the targets along the polyline cut, in the page's points. page: "" takes the page of the first target. |
scissorsAt | targets, point: [x, y], tolerance | Splits the one target path at the point. |
shapeBuild | targets, path: [[x, y], …], mode: "keep" | "remove" | Merges (keep) or removes (remove) the regions the path crosses. Ovals are refused. |
joinScrub | targets, page, path, tolerance | The Join tool: a scrub over a gap joins two open ends, over one path's ends closes it. |
pathErase | targets, page, path, width | The Path Eraser: removes the part of a stroke the scrub covers. |
reshapeAt | targets, point, to, radius, tolerance | The Reshape tool: drags the contour at point to to, with a falloff of radius. |
shaperStroke | targets, page, path | The Shaper: a freehand line, rectangle, ellipse, triangle or polygon drawn clean; a scribble over shapes merges or punches out regions. |
A cut that changes nothing fails with the reason (failed: …).
Liquify, Puppet Warp and the perspective grid
The distortion tools as data, each artwork change one undo step:
| Command | Arguments | What it does |
|---|---|---|
liquifyStroke | targets, page, kind: "warp" | "twirl" | "pucker" | "bloat" | "scallop" | "crystallize" | "wrinkle", path: [[x, y], …], and the tool's options (width, height, angle, intensity, detail, simplify, twirlRate, complexity, horizontal, vertical, affectAnchors, affectIn, affectOut, seed) | A press at the first point of path, a move per point, a release at the last, over the targets (every path on the page with none). The changed paths are re-fitted and written in one batch. |
puppetWarp | targets, holds: [[x, y], …], from, to, autoPins | Meshes the targets' outline, places autoPins automatic pins and a pin at each holds point, and drags the pin at from to to. |
perspectiveShowGrid, perspectiveHideGrid, perspectiveLockGrid, perspectiveUnlockGrid | page | The page's perspective grid. |
perspectiveOnePoint, perspectiveTwoPoint, perspectiveThreePoint | page | The grid presets. |
perspectiveSetPlane | page, plane: "left" | "right" | "floor" | "none" | The active plane. |
attachToPerspective, releaseFromPerspective | targets | Puts artwork on the active plane, or takes it off. |
moveOnPerspective | targets, from, to | Moves attached artwork along its plane. |
drawOnPerspective | page, shape: "rectangle" | "ellipse", from, to | Draws a shape on the active plane. |
The grid is a view setting: its edits take no undo step, and artwork attached to it does not follow a later grid edit. A Puppet Warp's pins do not outlast the command.
The width profile
widthProfile { targets, widths } is the Width tool's bake with the profile as
data. widths are full stroke widths at evenly spaced stops along the path, by
arc length: one width is uniform, [0, 8, 0] swells in the middle and tapers to
points. Each target that is a single-contour open path is replaced by its
outline, in one batch and one undo step; closed and compound paths are skipped,
and a call that outlines nothing fails with the reason. The result is
{ outlined: n }.
paged-node invoke drawing.paged media.paged.draw.command.widthProfile \
'{"targets":["polygon:u1f"],"widths":[0,8,0]}' --plugins=@paged-media/draw{ "command": "media.paged.draw.command.widthProfile", "applied": true, "result": { "outlined": 1 }, … }In the editor, the Path Options panel's Width profile section types a three-stop profile.
Recipes follow their sources
A pattern, repeat, blend, objects-on-path or live-paint group is a recipe:
artwork made from source items. In the editor, an edit that changes a source —
a mutation, a panel field, a drag of its handles — rebuilds the recipes it feeds
in the same undo step: one undo restores the source and the old artwork, one
redo replays both, and an undo or a redo never starts a rebuild. The bundle
fingerprints each recipe's sources (anchors and properties) and rebuilds those
whose fingerprint moved, once per commit, never per pointer move. It uses the
SDK's amended write
and is on by default; the Pattern, Repeat, Blend, Objects on path and Live paint
panels each carry an Update automatically when a source changes checkbox
(the bundle's storage key recipes.autoUpdate).
A script's edits are followed too: a script run is one undo step, and the rebuild joins it. A typed write to a recipe's own parameters (a repeat's count, a blend's steps) rebuilds its artwork in that write's step. Where the automatic update is off, or on a host without the amended write, update explicitly:
| Command | Arguments | Result |
|---|---|---|
updateLinkedRecipes | targets, all: bool | The addresses of the recipes it rebuilt. |
It runs, for every recipe whose sources are among targets (or every recipe,
with all: true), the update its own panel runs: updateRepeat,
updateBlend, editPatternField, updateObjectsOnPath, regenerateLivePaint.
A document without recipes is refused with the reason. The menu row is
Draw ▸ Update linked recipes.
The other commands
All take targets (a list of frame addresses) unless noted.
| Group | Commands |
|---|---|
| Gradient presets | fillGradientLinear, fillGradientRadial |
| Path operations | outlineStroke { width, cap, join, miterLimit }, offsetPath { delta, join, miterLimit }, simplifyPath { tolerance }, joinEndpoints, closePath, averageEndpoints, reversePathDirection, createOutlines, makeCompoundPath, releaseCompoundPath |
| Brushes | applyBrush { brush }, removeBrush, brushOptions { scalePct, spacingPct, … }, newBrush { type, name }, applyWidthProfile { profile, points } |
| Envelopes | envelopeMakeWithWarp { style, horizontal, bendPct, distortHPct, distortVPct }, envelopeMakeWithMesh { rows, columns }, envelopeMakeWithTopObject, envelopeEditContents, envelopeExpand, expandAppearance |
| Graphic styles | saveGraphicStyle { name }, applyGraphicStyle { style }, redefineGraphicStyle { style }, breakGraphicStyleLink, renameGraphicStyle { style, name }, deleteGraphicStyle { style }, importGraphicStyles { json }, exportGraphicStyles { styles, save }, mergeGraphicStyles { styles, name } |
| Symbols | defineSymbol { name, registration }, placeSymbolInstance { symbol, x, y }, redefineSymbol { symbol }, replaceSymbol { symbol }, symbolOptions { symbol, name, nineSlice }, breakSymbolLink, resetSymbolTransform, renameSymbol, deleteSymbol |
| Live paint | makeLivePaintGroup { name }, fillLivePaintFace { group, faces, fill }, regenerateLivePaint, selectLivePaintFaces, deleteLivePaintFace, releaseLivePaint |
| Type on a path | attachTextToPath { story, pathTypeAlignment, flipPathEffect }, detachTextFromPath |
| Select same | selectSameFill, selectSameStroke, selectSameStrokeWeight { tolerance }, selectSameOpacity, selectSameBlendMode, selectSameAppearance, selectSameGraphicStyle, selectSameSymbolInstance, selectSameShapeKind, globalEdit { tolerance, anySize } — each answers the selection |
| Shapes | insertArc, insertSpiral, insertRectGrid, insertPolarGrid, insertFlare — the generators' full parameters |
| Patterns, repeats, blends, objects on a path | makePatternFromSelection, savePatternSwatch { pattern, name }, makeRadialRepeat, makeGridRepeat, makeMirrorRepeat, blendSelected, makeObjectsOnPath, and per recipe its update, select, expand and release |
| Color | recolorArtwork { mode, rule, … } |
| Image trace and rasterize | imageTrace with the tracer's full option set, retraceImage, rasterize { ppi, background } |
| Generate | textToVector { prompt, route }, generativeRecolor { prompt } — through the host's AI and image-model doors; no model ships with the module |
paged commands --owner media.paged.draw --text lists each with its exact
argument schema.
Moved to the editor. The Pathfinder, the dash and corner presets, the
appearance stack's add, clear, remove and move, Reflect and Transform Again and
the opacity mask left paged.draw: each now has one implementation in the editor
(paged.pathfinder.*, paged.stroke.*, paged.corners.*,
paged.appearance.*, paged.transform.*, the Transparency panel), and the
media.paged.draw.command.* ids of those verbs are gone. A script reaches the
same results through the engine's own operations, such as
core.pathfinderBoolean and core.applyOpacityMask.
Module commands
The typed commands the built-in modules offer — one id and one argument schema, run the same way from a script, an extension and the Node command line.
paged.image commands
paged.image's typed commands — filter a region of a layer through a polygon or alpha mask, headless on CPU twins of the GPU kernels; crop, canvas size, turns, flips and adjustment layers by name.