Skip to main content
Known Participant
September 6, 2024
Question

.psjs script doesnot execute in PS 25.11

  • September 6, 2024
  • 2 replies
  • 274 views

scripts containing batch play commands not executing after saving as .psjs in PS version 25.11

alert added at the beginning of the execution also didnot execute.

 

I have tried placing  the file in preset/scripts folder as well.

Mac version - Ventura & Monterey

Please let me know how to resolve.

This topic has been closed for replies.

2 replies

Stephen Marsh
Community Expert
Community Expert
September 9, 2024

Can you get this one-liner to work? There is no BatchPlay, only UXP:

 

require('photoshop').app.showAlert("Hello world!");

 

What exact BatchPlay code? Is this a save step? Did you use Photoshop or Alchemist for the code?

 

What simplification steps have you used for troubleshooting to isolate and identify the issue?

Known Participant
September 10, 2024

Thanks for responding.  The provided one line works. But the below sample code for batchplay doesnot .

 

batchplay is used to run multiple actions . Used photopshop to import the action to script file.

 

async function samplePixel() {
return await require("photoshop").action.batchPlay([{
_obj: "colorSampler",
_target: {_ref: "document",_enum: "ordinal",_value: "targetEnum"},
samplePoint: {
horizontal: 100,
vertical: 100
}
}], {});
}
let result = await require("photoshop").core.executeAsModal(samplePixel, {"commandName": "Sample Pixel"});

Known Participant
September 9, 2024

Any help is appreciated, as we are not able to execute any scripts