atomicActions & scripts
photoshop_execute_script
Execute custom ExtendScript (JSX) code inside Photoshop (advanced escape hatch). Use when: no existing tool covers the operation and you can write safe JSX. Do NOT use when: a recipe or atomic tool exists — prefer photoshop_recipe_* or photoshop_* tools. Returns: script return value serialized as text/JSON. IMPORTANT: Your code runs inside a wrapping IIFE. Use an explicit `return` to pass data back — a bare trailing expression returns undefined. Example: `return { ok: true };` Objects are serialized with toSource() and parsed automatically on macOS and Windows. Preconditions: valid ExtendScript; active document if script expects one. Side effects: depends on code.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| code | string | yes | ExtendScript code to execute |
Community recipes
Nothing here yet. Be the first to share one.
Share a recipe