I would like to know if it is possible to get the value of the checkbox "select all layers" from the mixer brush tool. I would like to prepare a script so that I can select only the layers I want to blend, without needing to hide the layers. It's possible? Which way should I follow? I'm still new to Photoshop script development
Just off band, the value of a check box is either true or false. Getting the values of the layers for mixing colors is beyond the capability of extendscript. Unless you're actually wanting if the checkbox value of true or false.
sTT = stringIDToTypeID; (ref = new ActionReference()).putProperty(sTT('property'), sTT('tool')) ref.putClass(sTT('application')); (executeActionGet(ref)) .getObjectValue(sTT('currentToolOptions')) .getBoolean(sTT('sampleAllLayers'))
Loll, I really don't care if someone is beginner unless there will be more questions 🙂
I have a question. Why do you need ref2 ???
I originally provided a code where script checked if the Mixer Brush is a selected tool. Then I realised original poster did not ask for it, so I removed it, but forgot to remove also other parts belonging to. Thanks for the question. I edited code, so now all remains are cleared 😉
// select tool var r = new ActionReference(); r.putClass(stringIDToTypeID("wetBrushTool")); var d = new ActionDescriptor(); d.putReference(stringIDToTypeID("null"), r); executeAction(stringIDToTypeID("select"), d, DialogModes.NO); // get options var r = new ActionReference(); r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool")); r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum")); var flag = executeActionGet(r).getObjectValue(stringIDToTypeID("currentToolOptions")).getBoolean(stringIDToTypeID("sampleAllLayers")); alert(flag);
The user did not ask how to select Mixer Brush tool. Why do you assume he doesn't know how to do it?
Then your code doesn't work, for example if a hand is selected.
Or it doesn't work correctly in other cases.
Why are you giving a non-working code?
I'm not giving a non-working code. It works when Mixer Brush is selected. He didn't say anything he wants a script to check if this tool is selected, and if it's not then to select it. Perhaps he would not like a script to switch tools, but keep already selected one, so not checking MixerBrush until it's manually chosen? I'm giving to him only that he stated.
In fact, I would like to see the selected layers when I click on the checkbox of the mixer brush tool and from there remove some layers so they won't be merged