# Creating Action Object Inside Locked Project

**URL:** <https://forums.creativeclouddeveloper.com/t/creating-action-object-inside-locked-project/11792>\
**Category:** Premiere Pro\
**Tags:** uxp\
**Created:** [March 19, 2026, 3:39am UTC](https://forums.creativeclouddeveloper.com/t/creating-action-object-inside-locked-project/11792 "2026-03-19T03:39:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KuleshovEffect](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@KuleshovEffect](https://forums.creativeclouddeveloper.com/u/KuleshovEffect)\
**Post date:** [March 19, 2026, 3:39am UTC](https://forums.creativeclouddeveloper.com/t/creating-action-object-inside-locked-project/11792/1 "2026-03-19T03:39:38Z")

</div>

In most cases, I create an Action object inside my functions, and then send those objects to a separate function that executes them:

```auto
function executeAction(project, action) {
  try {
    project.lockedAccess(() => {
      project.executeTransaction((compoundAction) => {    
        compoundAction.addAction(action);
      });
    });
  } catch (err) {
    console.log(`Error: ${err}`);
  }
}

```

However, I’ve come across some Keyframe removing actions (`createRemoveKeyframeAction`**)** that always fail in my functions. According to the forum post below, there are some action objects that can **only** be created **after** locking the project:

> **[Help with the new UXP createInsertProjectItemAction() method. "Script Action...](https://community.adobe.com/questions-729/help-with-the-new-uxp-createinsertprojectitemaction-method-script-action-failed-to-execute-1417355)**
>
> Hi. I've been trying to use the new UXP createInsertProjectItemAction() method to insert a clip into my main sequence's timeline, but I can't seem to get it to work. I'm getting the following error ("Script Action failed to execute."):
>  
> 
> Here's the...

Indeed, `createRemoveKeyframeAction` works inside of `project.lockedAccess`.

Is there any way to tell which action objects have to be created inside of a locked project?

Thanks,  
Ted

---

<div class="post-metadata">

**Author:** ![justin2taylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/justin2taylor/32/2031_2.png) [@justin2taylor](https://forums.creativeclouddeveloper.com/u/justin2taylor)\
**Post date:** [April 8, 2026, 10:59pm UTC](https://forums.creativeclouddeveloper.com/t/creating-action-object-inside-locked-project/11792/2 "2026-04-08T22:59:16Z")

</div>

I don’t think there is a way to determine this currently, but it should be standardized.

To be safe, try and always create actions inside of a locked project whenever possible.

---

<div class="post-metadata">

**Author:** ![justin2taylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/justin2taylor/32/2031_2.png) [@justin2taylor](https://forums.creativeclouddeveloper.com/u/justin2taylor)\
**Post date:** [April 10, 2026, 8:47pm UTC](https://forums.creativeclouddeveloper.com/t/creating-action-object-inside-locked-project/11792/3 "2026-04-10T20:47:31Z")

</div>

It’s interesting, we’ve also noticed some functions allow creating actions outside of the lockedAccess on PC, but break on Mac.

It seems the safest bet is to always create the actions inside of the lockedAccess. Of course this does add some non-ideal syntax, but we’ve found a nice way around this with a Bolt UXP helper function that accepts functions that return actions, this way you can create the functions outside, but they’re actually generated inside of the lockedAccess context.

> <https://github.com/hyperbrew/bolt-uxp/blob/4c1cbe26e8b557eef75ac347cf6c035fc1329338/src/api/utils/premierepro-utils.ts#L16>

That way you can quite easily create action-returning-functions outside and pass them in:

```auto
const actions = clips.map(
    (clip) => () => clip.createSetDisabledAction(false),
);
await asTransactionSafe(proj, actions, "Set Enabled");

```

---

<div class="post-metadata">

**Author:** ![justin2taylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/justin2taylor/32/2031_2.png) [@justin2taylor](https://forums.creativeclouddeveloper.com/u/justin2taylor)\
**Post date:** [May 11, 2026, 3:58pm UTC](https://forums.creativeclouddeveloper.com/t/creating-action-object-inside-locked-project/11792/4 "2026-05-11T15:58:24Z")

</div>

UPDATE:

As of the latest Premiere Beta 26.3.0 (Build 70), actions must now ALWAYS be created inside of the locked + transaction scope, otherwise the transaction will error out.
