hi
great work thank you so much for helping i am really thankful
regards
Wael Mo,
Please try this:
// 2022, use it at your own risk;
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
var theChannels = myDocument.channels;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var theTotal = Number(myDocument.width) * Number(myDocument.height);
for (var m = theChannels.length - 1; m >= 0; m--) {
var thisChannel = theChannels[m];
if (thisChannel.kind == "ChannelType.SPOTCOLOR") {
thisChannel.visible = true;
var theHisto = thisChannel.histogram;
if (theHisto[255] == theTotal) {
thisChannel.visible = false;
thisChannel.remove()
} else {
thisChannel.visible = true
}
}
};
app.preferences.rulerUnits = originalRulerUnits;
};
Such a simple mistake …
I »counted« up instead of down.