ps_execute_script
Run custom ExtendScript inside Photoshop and return its result for tasks no built-in operation covers. Use an explicit return to pass data back.
Instructions
Run arbitrary ExtendScript in Photoshop and return its result. Use only when no ps_do operation covers the task. The code runs inside a function: use an explicit return to pass data back (objects are serialized); a bare trailing expression returns undefined.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"script": "<script>"
},
"name": "ps_execute_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | ExtendScript (ES3) source; end with `return …` |