pr_run_script
Execute custom ExtendScript in the open Premiere Pro project and return the result, enabling scripted edits and project automation.
Instructions
Run any ExtendScript in the open Premiere Pro project and return its result (body of a function; return sends data back). Helpers: KAI.seq(name), KAI.item(nameOrNodeIdOrBinPath), KAI.bin("a/b"), KAI.walk(fn), KAI.seqInfo(seq), KAI.clipInfo(clip), KAI.sec(time), KAI.time(seconds), KAI.tc(seq, seconds). ARGS holds args. Premiere has no scripted undo groups: save a version first (pr_save mode "version") before big edits.
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": {
"code": "<code>"
},
"name": "pr_run_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | ||
| code | Yes | ||
| timeout_sec | No | ||
| expected_project | No | Project guard: refuse to run unless the open .prproj path contains this text. Use it for every edit to a client project. |