Copy link to clipboard
Copied
I saw this discussion
https://community.adobe.com/t5/photoshop/script-call-dodge-amp-burn/m-p/10776697
where it is possible to modify dodge and burn by script
I would like to do the same thing for the spongeTool tool
Modify
starved / desaturated
flow
Vibrance.
1 Correct answer
Try
// flow
options.putInteger(stringIDToTypeID("flow"),50);
// mode
options.putEnumerated(stringIDToTypeID("mode"), stringIDToTypeID("blendMode"), stringIDToTypeID("desaturate"));
// or
options.putEnumerated(stringIDToTypeID("mode"), stringIDToTypeID("blendMode"), stringIDToTypeID("saturate"));
// vibrance
options.putBoolean(stringIDToTypeID("useLegacy"), true);
// or
options.putBoolean(stringIDToTypeID("useLegacy"), false);
Explore related tutorials & articles
Copy link to clipboard
Copied
Have you tried ScriptListener to see if it generates usable Action Manager code?
Copy link to clipboard
Copied
Try
// flow
options.putInteger(stringIDToTypeID("flow"),50);
// mode
options.putEnumerated(stringIDToTypeID("mode"), stringIDToTypeID("blendMode"), stringIDToTypeID("desaturate"));
// or
options.putEnumerated(stringIDToTypeID("mode"), stringIDToTypeID("blendMode"), stringIDToTypeID("saturate"));
// vibrance
options.putBoolean(stringIDToTypeID("useLegacy"), true);
// or
options.putBoolean(stringIDToTypeID("useLegacy"), false);
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Use this code
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
var options = executeActionGet(r).getObjectValue(stringIDToTypeID("currentToolOptions"));
The options variable is ActionDescriptor.
Knowing these keys (the class, type and value of the key can be obtained using the ActionDescriptor methods), you can then change the ones you need simply using the ActionDescriptor.putXXXX() methods and the remaining code in that topic.
Copy link to clipboard
Copied
Thank you for sharing your knowledge!
Copy link to clipboard
Copied
Mr. r-bin
I tried the code
Nothing happens when I operate it
does not work and does not change values.
This is what I did
am I doing something wrong
var desc23 = new ActionDescriptor();
var ref6 = new ActionReference();
ref6.putClass( charIDToTypeID( "SrTl" ));
desc23.putReference( charIDToTypeID( "null" ), ref6 );
executeAction( charIDToTypeID( "slct" ), desc23, DialogModes.NO );
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
var options = executeActionGet(r).getObjectValue(stringIDToTypeID("currentToolOptions"));
// flow
options.putInteger(stringIDToTypeID("flow"),50);
// mode
options.putEnumerated(stringIDToTypeID("mode"), stringIDToTypeID("blendMode"), stringIDToTypeID("desaturate"));
// or
//options.putEnumerated(stringIDToTypeID("mode"), stringIDToTypeID("blendMode"), stringIDToTypeID("saturate"));
// vibrance
//options.putBoolean(stringIDToTypeID("useLegacy"), true);
// or
options.putBoolean(stringIDToTypeID("useLegacy"), false);
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Perfect
r-bin you are the best
thanks
Copy link to clipboard
Copied
r-bin has given the best answer