Skip to main content
martinj65399781
Known Participant
October 23, 2020
Answered

Is it possible that the action step take the script name instead of "script" ?

  • October 23, 2020
  • 2 replies
  • 698 views

Hello community, i'm a french retoucher and new to scirpting in photoshop.

 

The title says it all :

When i record the execution of a default script like "flatten all masks", i get the right step name "flatten the masks" in french in the panel action, but for a every script of mine it displays "script" and i have to develop the step to see what it is.

 

I tried several things but nothing works so far.

And i precise that i don't know enough to go trough scripting panels and plugins.

 

Thanks a lot !

Have learn most of what i know about scritping here.

This topic has been closed for replies.
Correct answer jazz-y

Open source and add this to the beginning of every script you use. Set the name of the script in the menu and the name of the script in the action as you like.

UUID (type number 868572e6-d71e-4495-8a92-f8968960bb63) for each script it is better to generate your own.

Passing any parameter is needed for the Photoshop script to write them to the panel. I decided to put the name of the script file there.

 

   /*
   <javascriptresource>
   <name>My script name</name>
   <eventid>868572e6-d71e-4495-8a92-f8968960bb63</eventid>
   <terminology><![CDATA[<< /Version 1 
                            /Events << 
                             /868572e6-d71e-4495-8a92-f8968960bb63 [(My script name label)<<
                             >>] 
                            >> 
                         >> ]]></terminology>
   </javascriptresource>
   */

   (d = new ActionDescriptor).putString(stringIDToTypeID("null"), decodeURI(new File($.fileName).name));
app.playbackParameters = d;

 

2 replies

jazz-yCorrect answer
Legend
October 25, 2020

Open source and add this to the beginning of every script you use. Set the name of the script in the menu and the name of the script in the action as you like.

UUID (type number 868572e6-d71e-4495-8a92-f8968960bb63) for each script it is better to generate your own.

Passing any parameter is needed for the Photoshop script to write them to the panel. I decided to put the name of the script file there.

 

   /*
   <javascriptresource>
   <name>My script name</name>
   <eventid>868572e6-d71e-4495-8a92-f8968960bb63</eventid>
   <terminology><![CDATA[<< /Version 1 
                            /Events << 
                             /868572e6-d71e-4495-8a92-f8968960bb63 [(My script name label)<<
                             >>] 
                            >> 
                         >> ]]></terminology>
   </javascriptresource>
   */

   (d = new ActionDescriptor).putString(stringIDToTypeID("null"), decodeURI(new File($.fileName).name));
app.playbackParameters = d;

 

martinj65399781
Known Participant
October 25, 2020

You are awesome, that is exactly what i wanted, it works !

 

what is the eventid for ? how can i generete it ? i can put anything ?

Legend
October 25, 2020

This is a unique text string used to identify the script and passing parameters, both when launched from the Action Pane and when launched from other scripts. It can be anything, the main thing is that there are no repetitions with other scripts. The easiest way is to generate a random value, for example here:

Online UUID Generator

Chuck Uebele
Community Expert
Community Expert
October 23, 2020

No, the label script tells what type of command or step was done. You have to open up the step to see what the actual name of the script is. It would be nice though.

martinj65399781
Known Participant
October 25, 2020

Thanks you, ok that's too bad !