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.
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
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.
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now