Copy link to clipboard
Copied
Hello,
"Edit_Recto" is my action that double click on the layers "RECTO_EDIT" that works good by running it manually, but I want to run it with JSX Script.
app.activeDocument.activeLayer = app.activeDocument.artLayers.getByName("RECTO_EDIT");
app.doAction("?", "?");
I have tested many things :
=> app.doAction("RECTO_EDIT", "Edit_Recto");
=> app.doAction("Edit_Recto", "RECTO_EDIT");
=> app.doAction("Action", "Edit_Recto");
but is not working..
if someone can help to fix this, would be amazing :)
Thanks you!
The first parameter is the name of the action, and the second is the set the action is saved in—reverse the parameters in your 3rd version:
var act = "Edit_Recto"
var actset = "Action"
app.activeDocument.activeLayer = app.activeDocument.artLayers.getByName("RECTO_EDIT");
app.doAction(act, actset);
Copy link to clipboard
Copied
The first parameter is the name of the action, and the second is the set the action is saved in—reverse the parameters in your 3rd version:
var act = "Edit_Recto"
var actset = "Action"
app.activeDocument.activeLayer = app.activeDocument.artLayers.getByName("RECTO_EDIT");
app.doAction(act, actset);
Copy link to clipboard
Copied
Try this: put in the action set's name and the name of the action in the command to run the function.
playAction ('my action set', 'my action name')
function playAction(actionSet, actionName){
var idPly = charIDToTypeID( "Ply " );
var desc2 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var idActn = charIDToTypeID( "Actn" );
ref1.putName( idActn, actionSet );
var idASet = charIDToTypeID( "ASet" );
ref1.putName( idASet, actionName );
desc2.putReference( idnull, ref1 );
executeAction( idPly, desc2, DialogModes.NO );
}