Copy link to clipboard
Copied
I started making a script and i get stuck. Is it posible with javascript, from CMYK mode, to check does the psd(with multiply layers) contains spot(pantone) colors, and to make them hidden?
Thanks in advance.
BR,
Marko
It is effective for learning if you post the code you wrote and get your opinion.
I wrote a simple example. I hope it will be useful.
var doc = app.activeDocument;
var count = 0;
if(doc.mode == DocumentMode.CMYK && doc.channels.length > 4){
for(var i = 4; i < doc.channels.length; i++){
if(doc.channels[i].kind == ChannelType.SPOTCOLOR){
count++;
}
}
}
alert(count? "is" : "none");
Copy link to clipboard
Copied
I'm not following 100%, however, yes it is possible to check if there are spot colour channels in a file.
Copy link to clipboard
Copied
Ok, could you help me how?
Copy link to clipboard
Copied
Sorry, I don't have time now, you should be looking for:
ChannelType.SPOTCOLOR
If you search the forum or the web, I'm sure that you'll find something. If not, I'll revisit when I have time.
Perhaps somebody else can answer before then. Good luck!
Copy link to clipboard
Copied
It is effective for learning if you post the code you wrote and get your opinion.
I wrote a simple example. I hope it will be useful.
var doc = app.activeDocument;
var count = 0;
if(doc.mode == DocumentMode.CMYK && doc.channels.length > 4){
for(var i = 4; i < doc.channels.length; i++){
if(doc.channels[i].kind == ChannelType.SPOTCOLOR){
count++;
}
}
}
alert(count? "is" : "none");
Copy link to clipboard
Copied
Thanks guys, this helped me, i just changed one part of your script, and I got what i need.
var doc = app.activeDocument;
var count = 0;
if(doc.mode == DocumentMode.CMYK && doc.channels.length > 4){
for(var i = 4; i < doc.channels.length; i++){
if(doc.channels[i].kind == ChannelType.SPOTCOLOR){
doc.channels[i].visible=false;
}
}
}
Copy link to clipboard
Copied
@ajabon grinsmith - you should post more often!