• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Help script select spot Healing Brush Tool with "darken" mode in Photoshop

New Here ,
Nov 22, 2024 Nov 22, 2024

Copy link to clipboard

Copied

Hello!
Can someone help me with a script to select the Spot Healing Brush Tool with the "darken" mode in Photoshop? I have been able to select this tool as shown below, but I still can't switch it to the "darken" mode. Thank you very much!

var idslct = charIDToTypeID("slct");
var desc8 = new ActionDescriptor();
var idnull = charIDToTypeID("null");
var ref1 = new ActionReference();
var idspotHealingBrushTool = stringIDToTypeID("spotHealingBrushTool");
ref1.putClass(idspotHealingBrushTool);
desc8.putReference(idnull, ref1);
executeAction(idslct, desc8, DialogModes.NO);

Screenshot_1.png
TOPICS
Actions and scripting

Views

121

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
community guidelines

correct answers 1 Correct answer

People's Champ , Nov 22, 2024 Nov 22, 2024
Run this code after the code for selecting the desired tool. I can't test its functionality because I'm using an outdated version of PS, on which it doesn't work.
 

 

try {
    var r = new ActionReference();
    r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));
    r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));

    var ret = executeActionGet(r);

    var options = ret.getObjectValue(stringIDToTypeID("currentToolOp
...

Votes

Translate

Translate
Adobe
People's Champ ,
Nov 22, 2024 Nov 22, 2024

Copy link to clipboard

Copied

Run this code after the code for selecting the desired tool. I can't test its functionality because I'm using an outdated version of PS, on which it doesn't work.
 

 

try {
    var r = new ActionReference();
    r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));
    r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));

    var ret = executeActionGet(r);

    var options = ret.getObjectValue(stringIDToTypeID("currentToolOptions"));           
    var tool = ret.getEnumerationType(stringIDToTypeID("tool"));

    options.putEnumerated(stringIDToTypeID("mode"), stringIDToTypeID("blendMode"), stringIDToTypeID("darken"));

    var r = new ActionReference();
    r.putClass(tool);

    var d = new ActionDescriptor();
    d.putReference(stringIDToTypeID("null"), r);
    d.putObject(stringIDToTypeID("to"), stringIDToTypeID("null"), options);

    executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
} 
catch(e) { alert(e); }

 

Votes

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
community guidelines
Community Expert ,
Nov 22, 2024 Nov 22, 2024

Copy link to clipboard

Copied

@r-bin – I can confirm that your code does correctly set the tool blend mode to Darken.

 

P.S. On a related note, other topics including basic tool selection can be found here:

 

https://community.adobe.com/t5/photoshop/script-call-dodge-amp-burn/m-p/10776697

 

https://www.ps-scripts.com/viewtopic.php?f=68&t=11342&p=64930

 

Here is a topic where opacity is set:

 

Votes

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
community guidelines
Community Expert ,
Nov 23, 2024 Nov 23, 2024

Copy link to clipboard

Copied

@Stephen_A_Marsh , the last link (regarding the Clone Stamp Tool) seems to be the one you already posted regarding the Dodge and Burn Tools. 

Votes

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
community guidelines
Community Expert ,
Nov 23, 2024 Nov 23, 2024

Copy link to clipboard

Copied

LATEST

@c.pfaffenbichler 

 

Thanks! I have corrected the link.

Votes

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
community guidelines
New Here ,
Nov 22, 2024 Nov 22, 2024

Copy link to clipboard

Copied

Thank you very much, the code you provided has worked.

Votes

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
community guidelines
Community Expert ,
Nov 23, 2024 Nov 23, 2024

Copy link to clipboard

Copied

Please remember to mark a »Correct Answer« as such. 

Votes

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
community guidelines
New Here ,
Nov 23, 2024 Nov 23, 2024

Copy link to clipboard

Copied

Thank you for the reminder! I'll make sure to mark the correct answer.

Votes

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
community guidelines