5 Replies Latest reply on Sep 11, 2018 12:14 PM by Max Johnson - PlayStudios

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

    fabianf92607302

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

        • 1. Re: Where can we find a list of keys available in ActionDescriptor?
          xbytor2 Level 4

          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.

          • 3. Re: Where can we find a list of keys available in ActionDescriptor?
            Max Johnson - PlayStudios Level 1

            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...