batch_execute
Batch multiple MOHO operations into a single IPC call to reduce latency and improve efficiency. Group related reads, writes, or animation updates.
Instructions
Execute multiple MOHO operations in a single IPC round-trip (~300ms total) instead of one round-trip per call (~300ms each). PREFER THIS over individual calls whenever you have 2+ operations.
Method names use DOT notation: "bone.setTransform", "layer.getProperties", "animation.setKeyframe", etc. Params match each tool's schema exactly.
Supports all methods EXCEPT: document.screenshot (too slow), batch.execute (no nesting).
Common patterns:
Multi-frame animation: batch bone.setTransform across frames 1,5,10,15,...
Bulk reads: batch document.getInfo + document.getLayers + layer.getProperties for several layers
Keyframe + easing: batch animation.setKeyframe then animation.setInterpolation for each
Multi-bone pose: batch bone.setTransform for each bone in a skeleton at the same frame
Layer setup: batch layer.setName + layer.setVisibility + layer.setOpacity
Returns { results: [{ success, index, result|error }], summary: { total, executed, succeeded, failed, stoppedEarly } }. Use stopOnError: true when later operations depend on earlier ones succeeding.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operations | Yes | Array of operations to execute sequentially | |
| stopOnError | No | If true, stop executing after the first failed operation |