Python and the Photoshop Script listener, Part Two

If you read my earlier post about using the scripting listener to help write useful Python code, you probably noticed that there is alot of CharIDtoTypeID going on, followed by one of any number of ambiguous four letter codes.

You probably figured out that these are pretty much shorthand codes that call Photoshop functions. While that's useful to know, the raw script listener output does not make it too easy to work out exactly what they are calling. Most of these are listed in Appendix A of the VB, or Javascript, scripting guides.

Even better, if you are tech savvy enough and the appendix doesn't contain the information you need, you can download the relevant PhotoshopSDK for your version of Photoshop and poke around in the PITerminology.h file.

As an example, this VB scripting listener output:

idRGBC = objApp.CharIDToTypeID( "RGBC" )

Is calling upon this CharID, as seen in the PITerminology.h file:

#define classRGBColor  'RGBC' // keyRed, keyGreen, keyBlue.

As you can see, the great thing about this resource is that many of the available classes include comments that clarify other required components. Good resource for any scripter!

No comments:

Post a Comment

Comments?