Run ExtendScript
execute_extendscriptRun custom ExtendScript inside Premiere Pro when no dedicated tool covers a task, returning the script result as plain data.
Instructions
Run arbitrary ExtendScript inside Premiere Pro and return its result. Use it only when no dedicated tool covers the task (search with find_tools first); it can change or delete anything. ExtendScript is ES3: no let/const, arrow functions, JSON or Array.prototype.map. The helper library is available as $._pmcp (e.g. $._pmcp.seq({}), $._pmcp.json.stringify). Returns {result, type}; host objects in the result are converted to plain data. Premiere runs one script at a time, so a long script blocks every other tool until it ends; avoid loops of QE calls and never call APIs that open a dialog.
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": "execute_extendscript"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | ExtendScript source. Without as_function, the value of the last expression is returned. | |
| enable_qe | No | Enable the QE DOM (global `qe`) before running. Default false. | |
| as_function | No | Wrap the script in a function body so it can use `return`. Default false. | |
| timeout_seconds | No | How long the server waits for the result, in seconds, 1-3600. Default 60. |