Copy link to clipboard
Copied
I have hundreds of pictures to color.
Repeat the mask operation for each picture I think there's no way to quickly replace the script to achieve I changed the layer name to1
...function sTT(v) {return stringIDToTypeID(v)}
function slct(v) {
(ref = new ActionReference()).putIndex(sTT('layer'), v);
(dsc = new ActionDescriptor()).putReference(sTT('null'), ref)
executeAction(sTT('select'), dsc, DialogModes.NO)
}
function chnl() {
(ref1 = new ActionReference()).putProperty(sTT('channel'), sTT('selection'));
(dsc = new ActionDescriptor()).putReference(sTT('null'), ref1), dsc.putBoolean(sTT('invert'), true);
(ref2 = new ActionReference()).putEnumerated(sT
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I'm just trying to replace all 1 with a script implementation.
Copy link to clipboard
Copied
Because I have hundreds of pictures to do this.
Alt replacement Too slow
Who can help me write this script, thank you very much.
Copy link to clipboard
Copied
function sTT(v) {return stringIDToTypeID(v)}
function slct(v) {
(ref = new ActionReference()).putIndex(sTT('layer'), v);
(dsc = new ActionDescriptor()).putReference(sTT('null'), ref)
executeAction(sTT('select'), dsc, DialogModes.NO)
}
function chnl() {
(ref1 = new ActionReference()).putProperty(sTT('channel'), sTT('selection'));
(dsc = new ActionDescriptor()).putReference(sTT('null'), ref1), dsc.putBoolean(sTT('invert'), true);
(ref2 = new ActionReference()).putEnumerated(sTT('channel'), sTT('ordinal'), sTT('targetEnum'))
dsc.putReference(sTT('to'), ref2), executeAction(sTT('set'), dsc, DialogModes.NO)
}
for(i = 2; i < 6;) slct(i++), i > 3 ? executeAction(sTT('delete')): chnl()
Copy link to clipboard
Copied
This is a good finish I want
The script tried very well. Is the principle of replacing multiple layers up?
I want to have an immature idea of selecting multiple layers to replace the selected lowermost layer to all selected layers.
I think this can be enough to deal with multiple layers. If this is not the case, it is already very good.
Kukurykus is the best scripting expert I have ever seen. He is very enthusiastic.
Copy link to clipboard
Copied
I don't know what you mean by replacing multiple layers. For now if you want to replace content of adjustement layers over first adjuststement layer to its content you have to do it one by one, so the way you do it in Ps manually. It's how that script works. You can't select all layers and replace their contetnt at once or else you mean something else that I can't imagine? Perhaps you mean you want to select only certain adjustement layers manually (or still by script), so not all like in your example to run script then which is going to replace their content one by one to content of bottom adjustement one?
Copy link to clipboard
Copied
If you want to replace more than 3 layers, then how should you modify the script?
Copy link to clipboard
Copied
If you know exact number of adjustement layers then you change 6 to higher number, where 6 is for 4 layers. If not, then:
$.level = 0; try{for(i = 2;;) slct(i++), i > 3 ? executeAction(sTT('delete')) : chnl()}catch(err){}
Copy link to clipboard
Copied
Thank you, thank you very much, I understand a little bit.
It works very well
Thanks again Kukurykus
Copy link to clipboard
Copied
Are there any good tutorial videos or books on learning PS scripts?
Please know the seniors please give pointers
Copy link to clipboard
Copied
There are no tutorials, and for sure no good tutorials. No single videos even with basic stuff. You can learn from other codes.