Highlighted

Append to Action a Tool selection

Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

How can I append to an existing action, a tool change to a specific tool, so that after the action completes, the selected tool is the one chosen in the action step

 

For Example: After performing the action, the current selected tool becomes the Text Tool.

Most Valuable Participant
Correct answer by JJMack | Most Valuable Participant

Only selecting some tools record in an actions. To select other tools actions need to use a script. Selecting the text tool requires a script.

 

selectTool("typeCreateOrEditTool");
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 Photoshop tool names here you will not see the Frame tool here I even removed it from my Tool Bar so don't look here
'moveTool'                     'cloneStampTool'            'typeCreateOrEditTool'            'artboardTool'
'marqueeRectTool'              'patternStampTool'          'typeVerticalCreateOrEditTool'    'perspectiveCropTool'
'marqueeEllipTool'             'historyBrushTool'          'typeCreateMaskTool'              'eyedropperTool'              
'marqueeSingleRowTool'         'artBrushTool'              'typeVerticalCreateMaskTool'      '3DMaterialSelectTool'
'marqueeSingleColumnTool'      'eraserTool'                'pathComponentSelectTool'         "magicLassoTool" 
'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' 
*/

 

TOPICS
How to

Views

67

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Append to Action a Tool selection

Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

How can I append to an existing action, a tool change to a specific tool, so that after the action completes, the selected tool is the one chosen in the action step

 

For Example: After performing the action, the current selected tool becomes the Text Tool.

Most Valuable Participant
Correct answer by JJMack | Most Valuable Participant

Only selecting some tools record in an actions. To select other tools actions need to use a script. Selecting the text tool requires a script.

 

selectTool("typeCreateOrEditTool");
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 Photoshop tool names here you will not see the Frame tool here I even removed it from my Tool Bar so don't look here
'moveTool'                     'cloneStampTool'            'typeCreateOrEditTool'            'artboardTool'
'marqueeRectTool'              'patternStampTool'          'typeVerticalCreateOrEditTool'    'perspectiveCropTool'
'marqueeEllipTool'             'historyBrushTool'          'typeCreateMaskTool'              'eyedropperTool'              
'marqueeSingleRowTool'         'artBrushTool'              'typeVerticalCreateMaskTool'      '3DMaterialSelectTool'
'marqueeSingleColumnTool'      'eraserTool'                'pathComponentSelectTool'         "magicLassoTool" 
'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' 
*/

 

TOPICS
How to

Views

68

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 15, 2020 0
Most Valuable Participant ,
Oct 15, 2020

Copy link to clipboard

Copied

Only selecting some tools record in an actions. To select other tools actions need to use a script. Selecting the text tool requires a script.

 

selectTool("typeCreateOrEditTool");
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 Photoshop tool names here you will not see the Frame tool here I even removed it from my Tool Bar so don't look here
'moveTool'                     'cloneStampTool'            'typeCreateOrEditTool'            'artboardTool'
'marqueeRectTool'              'patternStampTool'          'typeVerticalCreateOrEditTool'    'perspectiveCropTool'
'marqueeEllipTool'             'historyBrushTool'          'typeCreateMaskTool'              'eyedropperTool'              
'marqueeSingleRowTool'         'artBrushTool'              'typeVerticalCreateMaskTool'      '3DMaterialSelectTool'
'marqueeSingleColumnTool'      'eraserTool'                'pathComponentSelectTool'         "magicLassoTool" 
'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' 
*/

 

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 2
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

Thanks. But how do I use the script in Actions ?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 0
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

Here is what I read about how to use scripting - https://helpx.adobe.com/photoshop/using/scripting.html

 

  1. Save it as a .js file to 'Photoshop CS5/Presets/Scripts folder'
  2. During Recording the action Use File > Scripts > Browse.. to run the Script

 

But I cannot find the Scripts folder in '~/Library/Application Support/Adobe/Presets/' .

Should I create one folder by name Scripts and save it there ?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 0
Adobe Community Professional ,
Oct 16, 2020

Copy link to clipboard

Copied

Do you have anything listed in File > Scripts > ?

 

If you do have then look again for Scripts folder.

 

If you have script in Scripts folder then you can run it from File > Scripts without browsing for it. If you use Browse to browse for script it should work fine too but be carefull to not move or accidentally delete that script which must be at location which is hard coded in action step.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 16, 2020 0
Community Beginner ,
Oct 16, 2020

Copy link to clipboard

Copied

Thanks for the reply. 

 

File > Scripts has these items, but I dont see a Scripts folder at '~/Library/Application Support/Adobe/Presets/'.

 

I tried creating one, but still the custom script does not appear under the File > Scripts menu 

 

file.scripts.png

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 16, 2020 0
Adobe Community Professional ,
Oct 16, 2020

Copy link to clipboard

Copied

"File > Scripts has these items, but I dont see a Scripts folder at '~/Library/Application Support/Adobe/Presets/"

 

I think you are looking in wrong folder. Try this instructions Applications > Photoshop CC > Presets > Scripts.

I am Windows user, you have Scripts folder but you are looking in wrong place.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 16, 2020 0
Community Beginner ,
Oct 16, 2020

Copy link to clipboard

Copied

Thank you.

My bad, the path I was looking for was in this screen shot. 

 

list.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 16, 2020 0
Community Beginner ,
Oct 19, 2020

Copy link to clipboard

Copied

Seems in Macos the Scripts folder is Located in `~/Applications/AdobePhotoshop2020/Scripts/`

I got a hint about locating it from an Aftereffects forum

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 19, 2020 0
Adobe Community Professional ,
Oct 19, 2020

Copy link to clipboard

Copied

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

P.S. Tool presets can often be recorded when the tool can't be directly recorded into an action.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 19, 2020 0