//Chris Whitaker //www.Funkybunnies3d.com // //simply cycle through a few important tools, //you can edit this by checking the list of tools at the bottom // //PaulMR did most of this work, I just set it up to cycle through... which was only a few lines, so big thanks to him! if (findCurrentTool() == 'paintbrushTool') selectTool('eraserTool'); else if (findCurrentTool() == 'eraserTool') selectTool('paintbrushTool'); //you can add more cases here if you want a bigger list to cycle through function selectTool(tool) { var desc9 = new ActionDescriptor(); var ref7 = new ActionReference(); ref7.putClass( app.stringIDToTypeID(tool) ); desc9.putReference( app.charIDToTypeID('null'), ref7 ); executeAction( app.charIDToTypeID('slct'), desc9, DialogModes.NO ); }; function findCurrentTool(){ var ref = new ActionReference(); ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); var cTool = typeIDToStringID( executeActionGet(ref).getEnumerationType(stringIDToTypeID('tool')) ); return cTool; }; //list of a buncha tools! //selectTool('moveTool'); //selectTool('marqueeRectTool'); //selectTool('marqueeEllipTool'); //selectTool('marqueeSingleRowTool'); //selectTool('marqueeSingleColumnTool'); //selectTool('lassoTool'); //selectTool('polySelTool'); //selectTool('magneticLassoTool'); //selectTool('quickSelectTool'); //selectTool('magicWandTool'); //selectTool('cropTool'); //selectTool('sliceTool'); //selectTool('sliceSelectTool'); //selectTool('spotHealingBrushTool'); //selectTool('magicStampTool'); //selectTool('patchSelection'); //selectTool('redEyeTool'); //selectTool('paintbrushTool'); //selectTool('pencilTool'); //selectTool('colorReplacementBrushTool'); //selectTool('cloneStampTool'); //selectTool('patternStampTool'); //selectTool('historyBrushTool'); //selectTool('artBrushTool'); //selectTool('eraserTool'); //selectTool('backgroundEraserTool'); //selectTool('magicEraserTool'); //selectTool('gradientTool'); //selectTool('bucketTool'); //selectTool('blurTool'); //selectTool('sharpenTool'); //selectTool('smudgeTool'); //selectTool('dodgeTool'); //selectTool('burnInTool'); //selectTool('saturationTool'); //selectTool('penTool'); //selectTool('freeformPenTool'); //selectTool('addKnotTool'); //selectTool('deleteKnotTool'); //selectTool('convertKnotTool'); //selectTool('typeCreateOrEditTool'); //selectTool('typeVerticalCreateOrEditTool'); //selectTool('typeCreateMaskTool'); //selectTool('typeVerticalCreateMaskTool'); //selectTool('pathComponentSelectTool'); //selectTool('directSelectTool'); //selectTool('rectangleTool'); //selectTool('roundedRectangleTool'); //selectTool('ellipseTool'); //selectTool('polygonTool'); //selectTool('lineTool'); //selectTool('customShapeTool'); //selectTool('textAnnotTool'); //selectTool('soundAnnotTool'); //selectTool('eyedropperTool'); //selectTool('colorSamplerTool'); //selectTool('rulerTool'); //selectTool('handTool'); //selectTool('zoomTool');