Page 1 of 1

Runing Action Name via Script

Posted: Fri Oct 05, 2018 5:39 pm
by qwerty1234
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

Re: Runing Action Name via Script

Posted: Tue Mar 10, 2020 12:40 pm
by Dormeur74
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.

Re: Runing Action Name via Script

Posted: Mon Apr 06, 2020 10:02 am
by Geoff
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"); } 
};

Re: Runing Action Name via Script

Posted: Mon Jul 13, 2020 7:25 am
by Amaresh1990
Thank you for your help. I'm looking for something like that

Re: Runing Action Name via Script

Posted: Tue Jul 14, 2020 8:34 am
by txuku
Bonjour

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")
}