Copy link to clipboard
Copied
Good evening! Is there a script that checks if a set of actions "myActions.atn" has already been loaded?
I use an extension in Photoshop that has a script that loads an action set whenever I restart Photoshop or the extension, but it creates a stack with the same set of actions in the action palette and an annoying shortcut conflict message appears with the menu shortcuts. Thanks for the help.
function loadActions () {
var actionFile =new File("~/desktop/myAction.atn");
if(actionFile.exists){app.load(actionFile)}
};
loadActions ();
var my_set_name = "myActions";
var found = false;
for (var i = 1;;i++)
{
var r = new ActionReference();
r.putIndex(stringIDToTypeID("actionSet"), i );
var set_name = null;
try { set_name = executeActionGet(r).getString(stringIDToTypeID("name")); } catch (e) { break; }
if (set_name == my_set_name) { found = true; break; }
}
if (found) alert(my_set_name + " alread
Copy link to clipboard
Copied
var my_set_name = "myActions";
var found = false;
for (var i = 1;;i++)
{
var r = new ActionReference();
r.putIndex(stringIDToTypeID("actionSet"), i );
var set_name = null;
try { set_name = executeActionGet(r).getString(stringIDToTypeID("name")); } catch (e) { break; }
if (set_name == my_set_name) { found = true; break; }
}
if (found) alert(my_set_name + " already loaded");
else alert(my_set_name + " was not load");
Copy link to clipboard
Copied
Perfect! My problem has been completely solved. Thanks for the script r-bin