Run Script
photopea_run_scriptExecute custom JavaScript in Photopea to automate advanced image editing tasks beyond standard tools. Access full Photopea DOM for direct manipulation of documents, layers, and more.
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
| 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.). |