Script To Delete All Channels Currently Not Active
-
Colorguy
Script To Delete All Channels Currently Not Active
I've been playing around with this one for a while and can't seem to get it. I often work with files that may have 30+ channels by the time I get the desired result. Once complete, I'm only going to be using maybe 5 or 6. So, unlike Layers where Photoshop has a function to delete all invisible Layers, its does not offer that for Channels and its a pain deleting one at a time. So what I've been trying to do is write a script that deletes all Channels that are not turned on. Any ideas is more than appreciated. Thanks!
-
larsen67
Script To Delete All Channels Currently Not Active
Well depending on your document mode this would remove all alphas…
Code: Select allapp.activeDocument.channels.removeAll();
If you are using multi-channel and just want to remove the non-visible then try …
Code: Select all#target photoshop
removeChannels();
function removeChannels() {
var i, doc, count;
doc = app.activeDocument;
count = doc.channels.length;
for ( i = count-1; i >= 0; i-- ) {
if ( doc.channels.visible == false ) { doc.channels.remove(); }
};
};
Code: Select allapp.activeDocument.channels.removeAll();
If you are using multi-channel and just want to remove the non-visible then try …
Code: Select all#target photoshop
removeChannels();
function removeChannels() {
var i, doc, count;
doc = app.activeDocument;
count = doc.channels.length;
for ( i = count-1; i >= 0; i-- ) {
if ( doc.channels.visible == false ) { doc.channels.remove(); }
};
};
-
Colorguy
Script To Delete All Channels Currently Not Active
Thanks for the help. Much appreciated.