PSJS scripts extremely slow?

Hello, is this normal that running a simple PSJS script like this

const app = require('photoshop').app;
app.activeDocument.createLayer({ name: "new layer"});

via the File > Scripts > Browse... menu takes about 3-4 seconds and not instant (like the JSX version does)? Tried on both Windows and Mac :confused:
If itโ€™s supposed to run instantly, is there anything I should check..?

Since createLayer is an async function, try adding await to it. My environment got faster by doing that.

const app = require('photoshop').app;
await app.activeDocument.createLayer({ name: "new layer"});
1 Like

Oh damn that was simple :sweat_smile: thank you

1 Like