What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

change value in many steps during action playback


Ninanoki

Well-Known Member
Messages
89
Likes
0
i've created an action that selects color range many times with fuziness: 15. i'd like to change this value 15 to any other ex.20. right now i have to manually change it many times.
Untitled-1.jpg
 
You will probably need to script that with a loop for the values you require.

Actions will allow value changes but you need to set it to display the dialog box and manually type in the value....this is what I assume you have already done although it doesn't show in your image.

Regards.
MrToM.
 
yes Tom, i've already tried that with a dialog but there are too many occurences to do this that way. i will search for the script examples.thanks.
 
I doubt you'll find a script for this exact action and I did really mean for you to write your own but whatever, good luck.

Regards.
MrToM.
 
What you could do is split your action into several actions that can be called from a script, here is a sample of code that should accomplish what you are after..

Code:
main();
function main(){
if(!documents.length) return;
var colour =new SolidColor();
//do the first part of shade analysids
app.doAction('ShadeAnalysis1', 'Default Actions');
//set the colour you want to select in hex
colour.rgb.hexValue = 'ff0000';
//select the colour range , fuzziness, inverse(true/false)
selectColourRange(colour,15,false);
//do the next part of the analysis
app.doAction('ShadeAnalysis2', 'Default Actions');
//select a different colour ??
//colour.rgb.hexValue = 'ff00ff';
//select the colour range with a different fuzziness
selectColourRange(colour,20,false);
//do another section of the analysis
app.doAction('ShadeAnalysis3', 'Default Actions');
selectColourRange(colour,25,false);
//repeat the above steps as required
};
function selectColourRange(clr, fuzz, inverse) { 
var desc = new ActionDescriptor(); 
desc.putInteger(charIDToTypeID("Fzns"), fuzz); 
var mnDesc = new ActionDescriptor();
mnDesc.putDouble(charIDToTypeID("Lmnc"), clr.lab.l); 
mnDesc.putDouble(charIDToTypeID("A   "), clr.lab.a); 
mnDesc.putDouble(charIDToTypeID("B   "), clr.lab.b); 
desc.putObject(charIDToTypeID("Mnm "), charIDToTypeID("LbCl"), mnDesc); 
var mxDesc = new ActionDescriptor(); 
mxDesc.putDouble(charIDToTypeID("Lmnc"), clr.lab.l); 
mxDesc.putDouble(charIDToTypeID("A   "), clr.lab.a); 
mxDesc.putDouble(charIDToTypeID("B   "), clr.lab.b); 
desc.putObject(charIDToTypeID("Mxm "), charIDToTypeID("LbCl"), mxDesc); 
if (inverse) { 
desc.putBoolean(charIDToTypeID("Invr"), inverse); 
} 
try{
executeAction( charIDToTypeID('ClrR'), desc, DialogModes.NO );
}catch(e){}
};
 
Last edited:

Back
Top