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

Change spongeTool values

Advocate ,
Dec 06, 2019 Dec 06, 2019

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.

 

Schermata 2019-12-06 alle 17.31.15.pngexpand image

TOPICS
Actions and scripting
2.1K
Translate
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 , Dec 06, 2019 Dec 06, 2019

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);
Translate
Adobe
LEGEND ,
Dec 06, 2019 Dec 06, 2019

Have you tried ScriptListener to see if it generates usable Action Manager code?

Translate
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
People's Champ ,
Dec 06, 2019 Dec 06, 2019

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);
Translate
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 ,
Dec 06, 2019 Dec 06, 2019

r-bin in this topic and in this older one, you have performed magic!

 

Can you share where/how others can work this out?

Translate
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
People's Champ ,
Dec 06, 2019 Dec 06, 2019

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.

Use the methods and properties of an ActionDescriptor (see documentation, e.g. photoshop-cc-javascript-ref-2019.pdf) to access the descriptor keys.
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.
 
(for CS6, changing currentToolOptions does not work. You can only read the descriptor (options) and find out the values)
 

 

 

Translate
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 ,
Dec 07, 2019 Dec 07, 2019

Thank you for sharing your knowledge!

Translate
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
Advocate ,
Dec 07, 2019 Dec 07, 2019

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);
Translate
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
People's Champ ,
Dec 07, 2019 Dec 07, 2019
There, at the Stephen_A_Marsh link above, there is still more code after options.put ...
 
Translate
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
Advocate ,
Dec 07, 2019 Dec 07, 2019
LATEST

Perfect
r-bin you are the best
thanks

Translate
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
Engaged ,
Dec 06, 2019 Dec 06, 2019

r-bin has given the best answer

Translate
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