Is there a way to Access Action Name and Action Set name from within the running action.
Such script would be helpful in self-documenting images produces by actions.
I see how it can be done with second action calling first, but that is not convenient for my workflow.
If this is not possible - are there any tools that would assist in associating actions and images that they produce.
TIA
Runing Action Name via Script
Re: Runing Action Name via Script
It is possible, in a script, to know the number and the names of the ActionSets (loaded) and the number and names of the Actions included.
But how to know which action is active when there are more than one ?
It is so simple to insert the action name in the metadatas of the active document at the beginning of an action creation. Each time the action will be used, its name will be inserted in the description of the file.
But how to know which action is active when there are more than one ?
It is so simple to insert the action name in the metadatas of the active document at the beginning of an action creation. Each time the action will be used, its name will be inserted in the description of the file.
Re: Runing Action Name via Script
This should work after the action has been run.
Code: Select all
#target photoshop;
getCurrentAction();
function getCurrentAction(){
var r = new ActionReference();
r.putEnumerated(stringIDToTypeID("action"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
try {
var ret = executeActionGet(r);
var act_name = ret.getString(stringIDToTypeID("name"));
var set_name = ret.getString(stringIDToTypeID("parentName"));
alert(set_name + "\n\n" + act_name, "Current Action")
}
catch(e) { alert("No action selected"); }
};
-
- Posts: 1
- Joined: Mon Jul 13, 2020 7:19 am
Re: Runing Action Name via Script
Thank you for your help. I'm looking for something like that
Re: Runing Action Name via Script
Bonjour
I use this script to do this :
I use this script to do this :
Code: Select all
//Hauteur_largeur.jsx
//appel de script .atn
//Remplacer scriptHoriz Script 182 et scriptAtnVertic Script 183
//par leurs references effectives dans vos scripts .atn
if (activeDocument.width> activeDocument.height)
{
doAction( "Script 182", "scriptAtnHoriz")
}
else
{
doAction( "Script 183", "scriptAtnVertic")
}