Complete Tool TypeID list for Photoshop CS5

Documentation, Reference material and Tutorials for Photoshop Scripting

Moderators: xbytor, DavideBarranca, Paul MR


Complete Tool TypeID list for Photoshop CS5

Postby dbosst » Thu Nov 24, 2011 10:53 pm

As I just learned, the string ID's are generated at runtime, so they change from session to session. But since some of the tools have string ID's and some are char ID's, its difficult to get all the type ID's in one place. This code will place all the tool type ID's in a dictionary and generate them at run time.

The benefit of this over having a separate handler just doing the lookups individually, is that this way you can see all the tool names in one file for easy reference.

For instance, if you want the bucket tool type ID, you just do
Code: Select allphsClass["bucketTool"]

The code, there are two pieces.

Code: Select all// in the start of the main script:
include '';

// in your creation complete
protected function creationCompleteHandler(event:FlexEvent):void {
  for (var i:Number = 0; i < phsClassToolStrings.length; i++) {
    phsClass[phsClassToolStrings] =;

And for the separate file:
Code: Select allprotected var phsClassToolStrings:Array = new Array (

Mike Hale

Complete Tool TypeID list for Photoshop CS5

Postby Mike Hale » Thu Nov 24, 2011 11:59 pm

The stringIDs are generated at runtime and can vary from Photoshop session to session. You can not depend on a stringID always having the same typeID as you can with charIDs.


Complete Tool TypeID list for Photoshop CS5

Postby dbosst » Fri Nov 25, 2011 2:10 am

Ah I just learned that! Doh! I'll edit the top post with a fix in a bit..

Return to “Photoshop Scripting: Reference, Documentation, & Tutorials”

Who is online

Users browsing this forum: No registered users and 2 guests