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