Skip to main content
Participant
January 29, 2015
Question

Where can we find a list of keys available in ActionDescriptor?

  • January 29, 2015
  • 3 replies
  • 2209 views

Where can we find a list of keys available in ActionDescriptor?Where can we find a list of keys available in ActionDescriptor?

This topic has been closed for replies.

3 replies

Known Participant
September 10, 2018

I just had a fore-head-slapping, why-didn't-I-think-of-this-sooner moment today and I can finally answer this question...

Save this as logTerminology.jsx and run it in whatever version of photoshop you want. You get a list of every available stringID in that version of PS, dumped into Terminology.jsx on your desktop. It's quick and dirty, but you can dress up the "terms +=" bit to customize the output to something more consumable.

Not tested on OSX.

logTerminology();

function logTerminology () {

    var terms="";

    var stringID, line;

    for ( var i=0; i<9999;i++)

    {

        try{

            stringID = typeIDToStringID( i );

            if( stringID.length)

            {

                terms += stringID + "\n";

            }

        } catch (e){}

       

    }

    writeTerminology(terms);

}

function writeTerminology( terminologyList ){

    // write generator config file

    var terminologyFile = new File("~/Desktop/Terminology.jsx");

    // Write to file

    if ( !terminologyFile.open( 'w' ) )

    {

      $.writeln( "Unable to open file\"" + terminologyFile + "\": " + terminologyFile.error + "." );

    }

    else if ( !terminologyFile.writeln( "" + terminologyList ) )

    {

      $.writeln( "Unable to write to file\"" + terminologyFile + "\": " + terminologyFile.error + "." );

    } else {

       

        $.writeln ("Successfully created "+terminologyFile.fsName);

        terminologyFile.close();

    }

}

Sadly, it still can't tell you what each of those is actually for ​but it's a start...

Geppetto Luis
Legend
September 11, 2018

Tested on mac high sierra

works well.

uberplugins
Inspiring
February 2, 2015
Inspiring
January 29, 2015

The keys for a particular ActionDescriptor can be determined by ActionDescriptor.getKey(), and the number of keys are determined by ActionDescriptor.count.

A complete list of all keys is not available anywhere that I know of, mostly because they even though the majority are in the PS app, others can be found in in

dynamically loaded libs, plugins, and in the Bridge app.

For the PS app keys, you can find them in header files for the binary/C header files in the dev kit.

I've taken the time to consolidate these keys in xtools/xlib/PSConstants.js. The header files that I use are:

PIStringTerminology.h, PITerminology.h, and PI3d.h.

The ids look like this:

PSClass._add("Color", "Clr ");

PSEnum._add("Right", "Rght");

PSEvent._add("Hide", "Hd  ");

PSForm._add("Class", "Clss");

PSKey._add("VersionMinor", "VrsN");

PSType._add("AlignDistributeSelector", "ADSt");

PSUnit._add("Pixels", "#Pxl");

The first value is the human readable form while the second value is the 4 char value you pass to app.charIDToTypeID() to get a key.

String IDs look like

PSString._add("32BitPreviewOptions");

or

PSString._add("3DSetGlobalAmbient", "set3DGlobalAmbient");

In the first case, the string is passed to stringIDToTypeID(), while the second case the first value is the human readable string

and the second is what you would pass to stringIDToTypeID(). The reason for the second case is that Adobe normalizes/standardizes

the name of stringID used in the dev kit API (over time) while maintaining the preexisting TypeID to maintain backwards compatibility.