Run Script
photopea_run_scriptDestructive
Execute custom JavaScript in Photopea to manipulate documents and layers via the full scripting API. Access app and activeDocument objects for advanced operations beyond standard tools.
Instructions
Execute arbitrary Photopea/ExtendScript JavaScript in the Photopea environment. Use this for advanced operations not covered by other tools. Has full access to the Photopea DOM (app, activeDocument, layers). Use with caution — scripts can modify or delete any document data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | Photopea JavaScript code to execute. Must call app.echoToOE(result) to return data. Has access to the full Photopea scripting API (app, activeDocument, etc.). |