Copy link to clipboard
Copied
I have written an action with a stop to allow an Eliptical Marquee to be drawn, to suit that particular photograph being processed.
It works fine as long as the correct tool is selected before running the action.
The Action should be able to re-set the required tool itself if another tool is active but it does not !
When recording an action, for example " The Clone Stamp " can be selected and it duly records in the action. The same is not the case for all tools esp. the one I want.
I have tried both clicking the tool and using the "M" shortcut key but neither work.
Sure I can put a message in the STOP text box to tell the user to change it but I feel this is a cop out. The thing should work the same as other tool selection record.
Any help/Advice appreciated.
Dave
Worst case you could use a little Script (paste the text into a text-file and save it with the extension jsx into the Presets/Scripts-Folder) and record it into the Action.
...
// =======================================================
var idslct = charIDToTypeID( "slct" );
var desc23 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref3 = new ActionReference();
var idmarqueeEllipTool = stringIDToTypeID( "marqueeEllipTool" );
ref3.putClass( idmarqueeElli
Copy link to clipboard
Copied
Worst case you could use a little Script (paste the text into a text-file and save it with the extension jsx into the Presets/Scripts-Folder) and record it into the Action.
// =======================================================
var idslct = charIDToTypeID( "slct" );
var desc23 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref3 = new ActionReference();
var idmarqueeEllipTool = stringIDToTypeID( "marqueeEllipTool" );
ref3.putClass( idmarqueeEllipTool );
desc23.putReference( idnull, ref3 );
var iddontRecord = stringIDToTypeID( "dontRecord" );
desc23.putBoolean( iddontRecord, true );
var idforceNotify = stringIDToTypeID( "forceNotify" );
desc23.putBoolean( idforceNotify, true );
executeAction( idslct, desc23, DialogModes.NO );
Copy link to clipboard
Copied
I am in your debt Sir thank you.
I was hoping for a more in app solution but this will be a way out in need.
Thank you so much for your time and trouble.
Dave
Copy link to clipboard
Copied
Unfortunately you have to include the Script with the Action if you pass it along to others.
Copy link to clipboard
Copied
And the script is different for each tool name.
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 );
};
/* Some of Photoshop internal tool names
'moveTool' 'cloneStampTool' 'typeCreateOrEditTool' 'artboardTool'
'marqueeRectTool' 'patternStampTool' 'typeVerticalCreateOrEditTool' 'perspectiveCropTool'
'marqueeEllipTool' 'historyBrushTool' 'typeCreateMaskTool' 'eyedropperTool'
'marqueeSingleRowTool' 'artBrushTool' 'typeVerticalCreateMaskTool' '3DMaterialSelectTool'
'marqueeSingleColumnTool' 'eraserTool' 'pathComponentSelectTool'
'lassoTool' 'backgroundEraserTool' 'directSelectTool'
'polySelTool' 'magicEraserTool' 'rectangleTool'
'magneticLassoTool' 'gradientTool' 'roundedRectangleTool'
'quickSelectTool' 'bucketTool' 'ellipseTool'
'magicWandTool' 'blurTool' 'polygonTool'
'cropTool' 'sharpenTool' 'lineTool'
'sliceTool' 'smudgeTool' 'customShapeTool'
'sliceSelectTool' 'dodgeTool' 'textAnnotTool'
'spotHealingBrushTool' 'burnInTool' 'soundAnnotTool'
'magicStampTool' 'saturationTool' 'eyedropperTool'
'patchSelection' 'penTool' 'colorSamplerTool'
'redEyeTool' 'freeformPenTool' 'rulerTool'
'paintbrushTool' 'addKnotTool' 'handTool'
'pencilTool' 'deleteKnotTool' 'zoomTool'
'colorReplacementBrushTool' 'convertKnotTool' 'wetBrushTool'
*/
Copy link to clipboard
Copied
Sweet. Thank you C.Pfaffenbichler and JJMack
Copy link to clipboard
Copied
When v2021 was released, I created an updated tool list. Just remove the comment //in front of the required tool. Please let me know if there are any errors or omissions...
//selectTool('moveTool');
//selectTool('artboardTool’);
//selectTool('marqueeRectTool');
//selectTool('marqueeEllipTool');
//selectTool('marqueeSingleRowTool');
//selectTool('marqueeSingleColumnTool');
//selectTool('lassoTool');
//selectTool('polySelTool');
//selectTool('magneticLassoTool');
//selectTool('magicLassoTool’);
//selectTool('quickSelectTool');
//selectTool('magicWandTool');
//selectTool('cropTool');
//selectTool('perspectiveCropTool’);
//selectTool('sliceTool');
//selectTool('sliceSelectTool');
//selectTool('framedGroupTool’);
//selectTool('eyedropperTool');
//selectTool('3DMaterialSelectTool’);
//selectTool('colorSamplerTool');
//selectTool('rulerTool');
//selectTool('textAnnotTool');
//selectTool('countTool’);
//selectTool('spotHealingBrushTool');
//selectTool('magicStampTool');
//selectTool('patchSelection');
//selectTool('recomposeSelection’);
//selectTool('redEyeTool');
//selectTool('paintbrushTool');
//selectTool('pencilTool');
//selectTool('colorReplacementBrushTool');
//selectTool('wetBrushTool’);
//selectTool('cloneStampTool');
//selectTool('patternStampTool');
//selectTool('historyBrushTool');
//selectTool('artBrushTool');
//selectTool('eraserTool');
//selectTool('backgroundEraserTool');
//selectTool('magicEraserTool');
//selectTool('gradientTool');
//selectTool('bucketTool');
//selectTool('3DMaterialDropTool’);
//selectTool('blurTool');
//selectTool('sharpenTool');
//selectTool('smudgeTool');
//selectTool('dodgeTool');
//selectTool('burnInTool');
//selectTool('saturationTool');
//selectTool('penTool');
//selectTool('freeformPenTool');
//selectTool('curvaturePenTool’);
//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('triangleTool’);
//selectTool('polygonTool');
//selectTool('lineTool');
//selectTool('customShapeTool');
//selectTool('handTool');
//selectTool('rotateTool’);
//selectTool('zoomTool’);
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 );
};
P.S. Actions can only select a tool by selecting a tool preset, not by directly selecting the tool... That being said, @r-bin has shown that it is possible to hack an action to do so!
Copy link to clipboard
Copied
That's Dope! Thanks for sharing.
Copy link to clipboard
Copied
I have added this to the "Action Helper Scripts" collection.
Copy link to clipboard
Copied
There does appear to be an error with the zoomTool. I've used the ellipseTool successfully, but trying to use the zoomTool results in the following error message popup 100% of the time:
-----
Error 4: Unterminated string constant.
Line: 78
-> selectTool('zoomTool');
-----
Thanks in advance for any help anyone can offer! 🙂
Copy link to clipboard
Copied
Hopefully fixed in the original topic (curly closing quote mark should be straight).