Loading and unload actions

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

Lost Plot

Loading and unload actions

Post by Lost Plot »

Hi

I believe it's possible for a script to load an action into the Photoshop action palette, is it also possible to remove an action from the palette?

Thanks,

CJ
Paul MR

Loading and unload actions

Post by Paul MR »

Code: Select all//load an action set
app.load(new File("/c/temp/actionSet.atn"));


function unLoadAction(action){
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putName( charIDToTypeID( "Actn" ), decodeURI(action));
desc.putReference( charIDToTypeID( "null" ), ref );
executeAction( charIDToTypeID( "Dlt " ), desc, DialogModes.NO );
};

function unLoadActionSet(actionSet){
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putName( charIDToTypeID( "ASet" ), decodeURI(actionSet));
desc.putReference( charIDToTypeID( "null" ), ref );
executeAction( charIDToTypeID( "Dlt " ), desc, DialogModes.NO );
};
Lost Plot

Loading and unload actions

Post by Lost Plot »

Brilliant!

Thanks for your help

CJ