execute_batch
Combine multiple InDesign editing operations into one atomic batch with automatic checkpointing, reducing round-trips and enabling rollback in a single undo step.
Instructions
Preferred mutation path: resolve targets → checkpoint gate → one dispatcher round-trip inside a single ENTIRE_SCRIPT undo transaction → modelPatch on cache. ALWAYS prefer this over execute_operation / layout_operation when combining ops. Mutating batches need an on-disk checkpoint for the current generation; the server takes one automatically and refuses the batch if saving it fails. Typical flow: scan_document → (analyze_page) → execute_batch → summarize_changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commands | Yes | Batch commands (prefer ONE execute_batch over many tools). Ops: checkpoint, move, resize, delete, duplicate, createTextFrame, setText, replaceText, setFont, setFill, align, distribute, center, stack, applyMargins, applyStyle, createStyle, updateStyle, relinkAsset, replaceAsset, embedAsset. checkpoint: {op:'checkpoint', tag?, keep?} saves an .indd copy to _checkpoints/ and runs before the undo transaction. createTextFrame: {op, x,y,width,height,text?} or {op, below:{role|uuid|selection}, gapPt?, text?}. Geometry in points. Requires prior scan_document (and analyze_page for role targets). | |
| timeoutSec | No | ||
| checkpointTag | No | Short reason for the automatic checkpoint filename | |
| skipCheckpoint | No | Mutate with no way back. Only when you deliberately accept that a bad edit cannot be rolled back (default false). | |
| transactionName | No | Label for the single undo step in InDesign (forced to ASCII) | |
| captureAfterSnapshot | No | Capture snapshot after (default true) |