Execute a script via a button
hi every one
I write a code to Execute a script via a button but i it didi not work can you help me to fiv this problem
thanks
the code:
function playAction(se1 ,action1){
setFound=false;
actionFound=false;
const actionSets = require('photoshop').app.actionTree;
// check for action set name to exist
if (actionSets[i].name==se1){var setToPlay=actionSets[i]; setFound=true;}
//check for action name to exist
if (setToPlay.actions[i].name==action1){var actionToPlay=setToPlay.actions[i]; actionFound=true;}
//play if action set/action both exist
if(setFound==true&&actionFound==true){await actionToPlay.play();}
}
