Getting the name of the Action that runs this script

If I create an action in photoshop to run a script named "test script", how can determine within the "test script" what name of the action started to run this script?  I am writing a script to resize my images.  The scale will be determined by what Action ran this script.

Example of

Action names are 5 x 7, 4 x 6, 8 x 10

Reproduced above action will run the same script, called "scale me."

In "scale me ', the java code will determine that 4 x 6 started running" scale me. "

"Level I" will go to the section in the java code to the scale of the image loaded into Photoshop for a 4 x 6 size.

The reason for writing the code "scale me" in this way, is that I can keep only one script to resize my images.

Any suggestion or help would be appreciated.

Raymond

I don't know of all average direct to determine the name of the action that began a script. You can find the name of the action highlighted / selected with this code.

var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Actn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);
var actionName = desc.getString( charIDToTypeID("Nm  ") );
var actionSetName = desc.getString( charIDToTypeID("PrNm") );
alert( 'Current selected action is: '+actionName+'\rin the action set: '+actionSetName );

But it is not infallible.

A better solution would be to set up your script to make it recordable action. The details are in the script as "JavaScript"resource guide. It you have that in place any action that registers the script you will store the values used. When the action is played again once you get these the app.playbackParameters calues. Image and layers of export files are two Adobe scripts that use a javascriptresource section.

Tags: Photoshop

Similar Questions

Maybe you are looking for

  • Satellite L100 - 103 Wireless Connection / W - lan is slow

    Hello everyone!I have a problem with my networkconnection wireless of my new PC toshiba laptop.Centrino 1.66 ghz, 512 MB rammy wireless card is called "Intel (r) PRO/Wireless 3945ABG Network Connection" So let me explain what the problems are:(1) the

  • How to burn the CD of backup recovery

    Hello: I have Vista and lost the user guide. I would like to know how I can burn backup CD recovery now. I think I need to reinstall the operating system in the future and do need the recovery CD and instructions on the way of recovering your system

  • How to print on a HP deskjet F4500 of a Chrome Chrome cloud wireless book?

    How to print on a HP deskjet F4500 of a Chrome Chrome cloud wireless book?

  • Computer webcam laptop Sony Vaio appears black

    Whenever I use Skype, oovoo, cameroid.com or whatever it is where my webcam needs access to, my webcam light seems to be on, but my webcam just appears black. And when using Skype, that may not be detected and the loading icon persists. How can I sol

  • How to make an app available by HTTP?

    A beginner question: I finished my MIDlet to Blackberry le Portage, everything works fine in the emulator. I don't have the equipment to do the final testing, a friend. I would like to make the app available through the net (HTTP maybe?) so that it c