# BatchPlay is failing to process descriptors containing "\_obj": "runJavaScript"

**URL:** <https://forums.creativeclouddeveloper.com/t/batchplay-is-failing-to-process-descriptors-containing-obj-runjavascript/11835>\
**Category:** UXP Plugin API\
**Tags:** uxp, api-feedback\
**Created:** [April 9, 2026, 2:46am UTC](https://forums.creativeclouddeveloper.com/t/batchplay-is-failing-to-process-descriptors-containing-obj-runjavascript/11835 "2026-04-09T02:46:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinhnn](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vinhnn](https://forums.creativeclouddeveloper.com/u/vinhnn)\
**Post date:** [April 9, 2026, 2:46am UTC](https://forums.creativeclouddeveloper.com/t/batchplay-is-failing-to-process-descriptors-containing-obj-runjavascript/11835/1 "2026-04-09T02:46:26Z")

</div>

Hi everyone,

I am developing a feature for my plugin that downloads remote `.psjs` files and executes them locally. However, I’ve run into an issue where `batchPlay` fails to execute the code.

Here is my current function:

JavaScript

```auto
async function runPSJS(path) {
    const fs = require('uxp').storage.localFileSystem;
    const token = await fs.createSessionToken(await fs.getEntryWithUrl("plugin-data:/" + path));
    
    return await action.batchPlay([
        {
            "_obj": "runJavaScript",
            "_target": [{ "_enum": "ordinal", "_ref": "application", "_value": "targetEnum" }],
            "file": { "_kind": "local", "_path": token }
        }
    ], {
        continueOnError: true
    });
};

```

**The problem:** I used the Actions Panel to record the step and converted it using the native “Copy as JavaScript” feature. The action works perfectly when played directly from the Actions Panel, but it does nothing (fails to execute) when triggered via `batchPlay` in my UXP code.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/1/1795a1a76ce7ad17d13ef8aff705c9b84fc87b51.png)

**Environment:**

- **UXP Version:** 7.4.1

- **Photoshop Version:** 25.9.0

Does anyone have an explanation for why `batchPlay` isn’t picking this up, or if there’s a specific permission/syntax I’m missing for `runJavaScript` in UXP?

---

<div class="post-metadata">

**Author:** ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)\
**Post date:** [April 9, 2026, 5:57am UTC](https://forums.creativeclouddeveloper.com/t/batchplay-is-failing-to-process-descriptors-containing-obj-runjavascript/11835/2 "2026-04-09T05:57:40Z")

</div>

You would also use this to execute an ExtendScript file. And the Adobe team did not want devs to mix those two together. So it does not work. Sadly, they do not distinguish between .jsx and .psjs

---

<div class="post-metadata">

**Author:** ![vinhnn](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vinhnn](https://forums.creativeclouddeveloper.com/u/vinhnn)\
**Post date:** [April 9, 2026, 6:40am UTC](https://forums.creativeclouddeveloper.com/t/batchplay-is-failing-to-process-descriptors-containing-obj-runjavascript/11835/4 "2026-04-09T06:40:24Z")

</div>

Funny enough, I can get it to work with `.jsx` files using the following function:

JavaScript

```auto
async function runJSX(path) {
    const fs = require('uxp').storage.localFileSystem;
    const token = fs.createSessionToken(await fs.getEntryWithUrl("plugin-data:/" + path));
    
    return await action.batchPlay([
        {
            _obj: "AdobeScriptAutomation Scripts",
            javaScript: {
                _path: token,
                _kind: "local"
            },
            javaScriptMessage: "JSM",
            _options: {
                dialogOptions: "dontDisplay"
            }
        }
    ], {
        continueOnError: true
    });
};

```

But for some reason, it just won’t work with `.psjs` files. This feels completely nonsensical—why would the older format work while the modern one doesn’t?

---

<div class="post-metadata">

**Author:** ![tomzag](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/tomzag/32/2464_2.png) [@tomzag](https://forums.creativeclouddeveloper.com/u/tomzag)\
**Post date:** [April 9, 2026, 6:46am UTC](https://forums.creativeclouddeveloper.com/t/batchplay-is-failing-to-process-descriptors-containing-obj-runjavascript/11835/5 "2026-04-09T06:46:12Z")

</div>

Adobe restricts to run UXP scripts from UXP plugins.  
Check out this thread: [Panel with buttons to run psjs files](https://forums.creativeclouddeveloper.com/t/panel-with-buttons-to-run-psjs-files/6050)
