views:

9

answers:

1

Hi all. I read a tutorial of photoshop scripting, and I can't understand this line.

//get action ID
cTID = function(s) { return app.charIDToTypeID(s); }; 
sTID = function(s) { return app.stringIDToTypeID(s); }; 

I think these codes are call Photoshop actions, but I don't have any references, so I can't really understand how to use these. Why are they need and How to use these?

A: 

Well, the code you posted creates convenient aliases for the charIDToTypeID and stringIDToTypeID functions. Those functions simply convert strings to an enumeration value of type PSConstants. For instance,

CharIDToTypeID("BD1") //returns 1111765280 which corresponds to PSConstants.phEnumBitDepth1

See http://www.pcpix.com/Photoshop/

Rodrick Chapman