mike kypriotis
mike kypriotis

Reputation: 105

Where to find list of class IDs for photoshop jsx / extendscript

While learning about Photoshop scripting I found about the Action Manager, the ScriptListener Plug-In and how it can generate code based on your actions. Sergey Kritskiy was kind enough to help me with a proposed solution (How to adjust the colors of a large number of images based on one spesific?) but there are a lot of class IDs -which are used in charIDToTypeID(), that I do not understand (the code needs to be documented since it will go into my thesis). Strangely there is an index of all EventIDs in the photoshop-cc-javascript-ref-2019.pdf available at adobe help center but cannot find anything similar for class IDs. I googled quite a bit but cannot find anything of the sort. Am I doing something wrong?

For instance the following is the code generated for the filter > Stylize > Emboss (example taken from photoshop-cc-scripting-guide-2019.pdf -from adobe help center )

var idEmbs = charIDToTypeID( "Embs" );
var desc24 = new ActionDescriptor();
var idAngl = charIDToTypeID( "Angl" );
desc24.putInteger( idAngl, 135 );
var idHght = charIDToTypeID( "Hght" );
desc24.putInteger( idHght, 3 );
var idAmnt = charIDToTypeID( "Amnt" );
desc24.putInteger( idAmnt, 100 );
executeAction( idEmbs, desc24, DialogModes.NO );

The 'Embs' is an event Id, while 'Angl', 'Hght', 'Amnt' are class Ids. But while those are easy to guess others like 'Lctn, 'Mdpn', 'Opct' or '#Prc' are not (least to a novice like me)

Upvotes: 1

Views: 771

Answers (1)

Jongware
Jongware

Reputation: 22457

Download the Photoshop SDK. Inside you'll find some documentation in HTML format.

The key Lctn, for example, can be found in the full 'Adobe Photoshop SDK File List', inside PITerminology.h (to be fair, I had to use a File Search utility to locate it):

#define keyLocation   'Lctn' 

In turn, where is this used then? There is some minimal guidance where these are used in `Photoshop Actions Guide.pdf'; it seems all of your abbreviations are function arguments.

Lctn, again for example, is used in eventStroke:

Table 4–36: eventStroke Parameters (6)

Key    Type    Bounds    Options
keyWidth ('Wdth')    typeInteger   flagsSingleParameter
keyLocation ('Lctn') typeStrokeLocation ('StrL')   flagsEnumeratedParameter
keyOpacity ('Opct') unitFloat/unitPercent ('#Prc')   flagsEnumeratedParameter
keyMode ('Md ') typeBlendMode ('BldM')   flagsEnumeratedParameter
keyPreserveTransparency ('PrsT')   typeBoolean   flagsOptionalEnumeratedParameter
keyUsing ('Usrs')   typeClass ('Type')   flagsOptionalSingleParameter

Yeah. This really is badly documented.

Upvotes: 1

Related Questions