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

Change spongeTool values

Advocate ,
Dec 06, 2019 Dec 06, 2019

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.

 

Schermata 2019-12-06 alle 17.31.15.png

TOPICS
Actions and scripting

Views

1.8K

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 , 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);

Votes

Translate

Translate
Adobe
LEGEND ,
Dec 06, 2019 Dec 06, 2019

Copy link to clipboard

Copied

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

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

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);

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

Copy link to clipboard

Copied

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

 

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

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

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.

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)
 

 

 

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

Copy link to clipboard

Copied

Thank you for sharing your knowledge!

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

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);

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

Copy link to clipboard

Copied

There, at the Stephen_A_Marsh link above, there is still more code after options.put ...
 

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

Copy link to clipboard

Copied

LATEST

Perfect
r-bin you are the best
thanks

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

Copy link to clipboard

Copied

r-bin has given the best 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