Copy link to clipboard
Copied
Hello,
I want to use the executeAction function.
But everytime i try to use it i get this error message:
Error 8800 This functionality may not be available in this version of photoshop.
line xy
executeAction.....
Here some example code:
var actionID = stringIDToTypeID("myTestAction");
var actionDescriptor = new ActionDescriptor();
executeAction(actionID, actionDescriptor, DialogModes.NO);
I need to use this function in many other situations but it never works.
Can someone Help me please?
Thanks
Copy link to clipboard
Copied
see if this works for you
try {
var actionID = stringIDToTypeID("myTestAction");
var actionDescriptor = new ActionDescriptor();
executeAction(actionID, actionDescriptor, DialogModes.NO);
} catch (e) { if (alert("8800")) { throw(e); } }
Copy link to clipboard
Copied
I'm a little confused, the docs state:
"Plays an ActionManager event."
While it appears that you want to play an action with a custom name: "myTestAction," – not call an internal application event name or code.
So, if you do wish to play an action loaded in the action panel, use legacy ExtendScript .jsx code such as:
app.doAction("Molten Lead","Default Actions.atn");
Or:
var actionName = "Molten Lead"; // Child action to run
var actionSet = "Default Actions"; // Parent action set
app.doAction(actionName,actionSet);
Or:
playAction ('My Action Set', 'My Action')
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 );
}
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more