pr_uxp_run
Run modern async JavaScript in Premiere Pro via the UXP API to automate tasks ExtendScript cannot handle, using await/return and built-in project, sequence, clip, and undo helpers.
Instructions
Run modern async JavaScript in Premiere through its UXP API (require("premierepro") is KAI.ppro). Use await and return. Helpers: KAI.project(), KAI.seq(name), KAI.t(seconds)->TickTime, KAI.sec(tickTime), KAI.tracks(seq, "video"|"audio"), KAI.clips(seq, kind, trackIndex) -> [{track,index,item}], KAI.clipInfo(c), KAI.items(), KAI.effectNames(), KAI.transact(label, (compound) => { compound.addAction(...) }) for ONE undoable step. ARGS holds args. Use this for what ExtendScript cannot do; use pr_run_script for everything else.
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_uxp_run"
}
}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. |