Complete Tool TypeID list for Photoshop CS5
Posted: 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 'toolStrings.as';
// in your creation complete
protected function creationCompleteHandler(event:FlexEvent):void {
for (var i:Number = 0; i < phsClassToolStrings.length; i++) {
phsClass[phsClassToolStrings] = Photoshop.app.stringIDToTypeID(phsClassToolStrings);
}
}
And for the separate toolStrings.as file:
Code: Select allprotected var phsClassToolStrings:Array = new Array (
"3DFOVTool",
"3DObjectPanTool",
"3DObjectRollTool",
"3DObjectRotateTool",
"3DObjectScaleTool",
"3DObjectSlideTool",
"3DOrbitCameraTool",
"3DPanCameraTool",
"3DRollCameraTool",
"3DWalkCameraTool",
"addKnotTool",
"artBrushTool",
"backgroundEraserTool",
"blurTool",
"bucketTool",
"burnInTool",
"cloneStampTool",
"colorReplacementBrushTool",
"colorSamplerTool",
"convertKnotTool",
"countTool",
"cropTool",
"customShapeTool",
"deleteKnotTool",
"directSelectTool",
"dodgeTool",
"ellipseTool",
"eraserTool",
"eyedropperTool",
"freeformPenTool",
"gradientTool",
"handTool",
"historyBrushTool",
"lassoTool",
"lineTool",
"magicEraserTool",
"magicStampTool",
"magicWandTool",
"magneticLassoTool",
"marqueeEllipTool",
"marqueeRectTool",
"marqueeSingleColumnTool",
"marqueeSingleRowTool",
"moveTool",
"paintbrushTool",
"patchSelection",
"pathComponentSelectTool",
"patternStampTool",
"penTool",
"pencilTool",
"polySelTool",
"polygonTool",
"quickSelectTool",
"rectangleTool",
"redEyeTool",
"rotateTool",
"roundedRectangleTool",
"rulerTool",
"saturationTool",
"sharpenTool",
"sliceSelectTool",
"sliceTool",
"smudgeTool",
"spotHealingBrushTool",
"textAnnotTool",
"typeCreateMaskTool",
"typeCreateOrEditTool",
"typeVerticalCreateMaskTool",
"typeVerticalCreateOrEditTool",
"wetBrushTool",
"zoomTool"
);
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 'toolStrings.as';
// in your creation complete
protected function creationCompleteHandler(event:FlexEvent):void {
for (var i:Number = 0; i < phsClassToolStrings.length; i++) {
phsClass[phsClassToolStrings] = Photoshop.app.stringIDToTypeID(phsClassToolStrings);
}
}
And for the separate toolStrings.as file:
Code: Select allprotected var phsClassToolStrings:Array = new Array (
"3DFOVTool",
"3DObjectPanTool",
"3DObjectRollTool",
"3DObjectRotateTool",
"3DObjectScaleTool",
"3DObjectSlideTool",
"3DOrbitCameraTool",
"3DPanCameraTool",
"3DRollCameraTool",
"3DWalkCameraTool",
"addKnotTool",
"artBrushTool",
"backgroundEraserTool",
"blurTool",
"bucketTool",
"burnInTool",
"cloneStampTool",
"colorReplacementBrushTool",
"colorSamplerTool",
"convertKnotTool",
"countTool",
"cropTool",
"customShapeTool",
"deleteKnotTool",
"directSelectTool",
"dodgeTool",
"ellipseTool",
"eraserTool",
"eyedropperTool",
"freeformPenTool",
"gradientTool",
"handTool",
"historyBrushTool",
"lassoTool",
"lineTool",
"magicEraserTool",
"magicStampTool",
"magicWandTool",
"magneticLassoTool",
"marqueeEllipTool",
"marqueeRectTool",
"marqueeSingleColumnTool",
"marqueeSingleRowTool",
"moveTool",
"paintbrushTool",
"patchSelection",
"pathComponentSelectTool",
"patternStampTool",
"penTool",
"pencilTool",
"polySelTool",
"polygonTool",
"quickSelectTool",
"rectangleTool",
"redEyeTool",
"rotateTool",
"roundedRectangleTool",
"rulerTool",
"saturationTool",
"sharpenTool",
"sliceSelectTool",
"sliceTool",
"smudgeTool",
"spotHealingBrushTool",
"textAnnotTool",
"typeCreateMaskTool",
"typeCreateOrEditTool",
"typeVerticalCreateMaskTool",
"typeVerticalCreateOrEditTool",
"wetBrushTool",
"zoomTool"
);
Code: Select all