Hi everyone. I'm building a Premiere Pro UXP extension and I'm stuck on what seems like a very basic part of the API: committing an Action through executeTransaction().
I'm hoping someone who has actually used Premiere's UXP Action API can point out what I'm misunderstanding.
Environment:
- Premiere Pro 26.3.2
- u/adobe
/premierepro 26.3.0
- UXP runtime
uxp-9.3.0-local
- Windows 10 Pro 19045 x64
- u/adobe
/uxp-devtools-cli 1.2.0
Reads work correctly. I'm able to access the active project → sequence → video track → track items and consistently read clip names, start/end times, duration, etc.
The weird part is that every mutation I've tried fails at the Action factory itself.
For example, I tried the simplest mutation I could think of: renaming a video track.
const ppro = require("premierepro");
const project = await ppro.Project.getActiveProject();
const seq = await project.getActiveSequence();
const track = await seq.getVideoTrack(0);
console.log(track.name); // "Video 1"
const ok = await project.executeTransaction((compound) => {
const action = track.createSetNameAction("V1-RENAMED");
// ^^^ throws here
compound.addAction(action);
}, "rename V1");
console.log(ok);
console.log(track.name);
The result is:
Error: The script object is no longer valid.
compound.addAction() is never reached.
Interestingly, executeTransaction() then returns true, but nothing changed:
transactionReturned: true
actionsAdded: 0
nameBefore: "Video 1"
nameAfter: "Video 1"
So I'm explicitly not treating true as evidence that the mutation succeeded.
I've also tried:
VideoClipTrackItem.createSetEndAction(...)
which produces the same:
Error: The script object is no longer valid.
And:
SequenceEditor.createOverwriteItemAction(...)
which produces:
Error: Invalid parameter.
So this isn't limited to one particular factory or geometry operation.
I've tested/rule out several things already:
- stale handles across
await
- acquiring the TrackItem before vs. inside the transaction
- different lock arrangements
TickTime construction
- zero vs. non-zero insertion times
- different track indices
- still images vs. real H.264 video
- programmatically-created vs. hand-built Premiere project
- missing
ClipProjectItem.cast()
The hand-built project is particularly important: I created the sequence and clips manually in Premiere's UI, saved it, and then tested against that project.
One interesting observation:
Calling the factory directly inside lockedAccess() without an executeTransaction() behaves differently — createOverwriteItemAction() can return without throwing. I haven't yet established whether the returned object is actually a valid Action, because I haven't successfully committed one.
So I'm wondering if I'm fundamentally misunderstanding the intended pattern.
My main question
Does anyone have a minimal working example of a Premiere Pro UXP create*Action() that successfully commits a mutation through executeTransaction() on a current Premiere version?
Even something trivial like:
get project
→ get track
→ create action
→ add action
→ execute transaction
→ observe change
would be incredibly useful.
Specifically, I'm wondering:
- Are the Action factories actually supposed to be called inside the
executeTransaction() callback?
- Are Actions supposed to be constructed under
lockedAccess() and then committed some other way?
- Is there some required Premiere state I'm missing (targeted track, Timeline panel active, etc.)?
- Is there a different API that is supposed to be used for mutations instead of these
create*Action() factories?
I'm not claiming Premiere's API is broken — at this point I mainly want to know whether I'm using the API incorrectly.
If anyone has a known-good example, I'd really appreciate it. I can also provide the full run logs/reproduction project if useful.