/////////////////////////// //SET-UP /USER VARIABLES /////////////////////////// //Localized path to the Plug-Ins folder var strPlugInsFolderDirectory = localize( "$$$/LocalizedFilenames.xml/SourceDirectoryName/id/Extras/[LOCALE]/[LOCALE]_Plug-ins/value=Plug-ins" ); //The Path to the action you want to install var actionFile = File(app.path.toString() + "/" + strPlugInsFolderDirectory + "/Panels/PanosFX/content/The%20BnBig%20picture.atn" ); //The Action Set Name var actionSet = "The BnBig picture"; //The Action Name var action = "THE ACTION"; /////////////////////////// // FUNCTIONS /////////////////////////// var actionLoaded = false;// Set actionLoaded to false until we find a match // Functions to get the list of action sets currently installed cTID = function( s ) { return app.charIDToTypeID( s ); }; getActionSets = function() { var i = 1; var sets = [ ]; while ( true ) { var ref = new ActionReference(); ref.putIndex( cTID( "ASet" ), i ); var desc; var lvl = $.level; $.level = 0; try { desc = executeActionGet( ref ); } catch ( e ) { break; // all done } finally { $.level = lvl; } if ( desc.hasKey( cTID( "Nm " ) ) ) { var set = { }; set.index = i; set.name = desc.getString( cTID( "Nm " ) ); set.toString = function( ) { return this.name; }; set.count = desc.getInteger( cTID( "NmbC" ) ); set.actions = [ ]; for ( var j = 1; j <= set.count; j++ ) { var ref = new ActionReference( ); ref.putIndex( cTID( 'Actn' ), j ); ref.putIndex( cTID( 'ASet' ), set.index ); var adesc = executeActionGet( ref ); var actName = adesc.getString( cTID( 'Nm ' ) ); set.actions.push( actName ); } sets.push( set ); } i++; } return sets; }; var sets = getActionSets( );// get users actions sets // walk through the layer sets for (i=0; i