const app = require("photoshop").app;
const batchPlay = require("photoshop").action.batchPlay;
const deleteChannels = async(indexID) => {
return await batchPlay(
[
{
_obj: "delete",
_target: [
{
_ref: "channel",
_index: indexID
}
],
_options: {
dialogOptions: "dontDisplay"
}
}
],{
synchronousExecution: false,
modalBehavior: "fail"
});
}
await deleteChannels(5)
getting an error with this function “Uncaught Error: Event: delete may modify the state of Photoshop. Such events are only allowed from inside a modal scope”
trying to debug it but can’t get it to work…
many thanks for your help