Copy link to clipboard
Copied
Hi Scripters,
i have very big problem to change the SPOT COLOR TO PROCESS CYMK its working and changing fine but since the "GLOBAL" options is enabled, its not converting the spot into exact cmyk process color.
Here is my js code:
var myDoc = app.activeDocument;
for(j=0; j<myDoc.swatches.length; j++){
if(myDoc.swatches
alert(myDoc.swatches
myDoc.swatches
}
}
thx,
csm_phil
Copy link to clipboard
Copied
Phil, this is off the top of my head… but editing spots in the swatches panel breaks all association with the applied art… They will change but the art will not be mapped to this…
Copy link to clipboard
Copied
Hi Mark,
Thanx for your reply, however my art does not have any linked images, it just consist of normal rectangular frames with SPOT FIll color.
My requirement is to convert every Spot Colors into CMYK Color in the document swatches.
My above script does this action, but as the "GLOBAL" options cannot be disabled it is retained/changed as Spot CMYK color.
thx,
csm_phil
Copy link to clipboard
Copied
Phil, Im not taking about colored links to images… I will have to check but Im fairly sure that when you change a swatches type from spot to process it just breaks it. No colored art is changed, pathItems the lot…
Copy link to clipboard
Copied
Hi Mark,
I have manually checked a swatch by changing the SPOT to Process CMYK and found that its related colored items in the art gets changed automatically to the converted Process CMYK.
As we are not able to do the above action, we have used another logic like create new Process CMYK swatch based on the SPOT Color and then finally delete all the SPOT Colors used in the document
But my requirement is to disable the "GLOBAL" Option while converting SPOT TO Process CMYK in the swatches rather than creating a new color and deleting the SPOT Color.
Below is the JS code for the above mentioned logic:
var myDoc = app.activeDocument;
var spotcnt = myDoc.spots.length;
for(i=0; i<=spotcnt-1; i++){
var spotname = "";
var spotvalue = [];
if(myDoc.spots.name!="[Registration]"){
spotname = myDoc.spots.name;
spotvalue = myDoc.spots.getInternalColor();
mycolor = myDoc.swatches.add();
mycolor.name = spotname;
mycolor.color = CMYKColor;
mycolor.color.cyan = spotvalue[0];
mycolor.color.magenta = spotvalue[1];
mycolor.color.yellow = spotvalue[2];
mycolor.color.black = spotvalue[3];
}
}
if (spotcnt > 0){
app.activeDocument.spots.removeAll();
}
Please share your comments.
thx,
csm_phil
Copy link to clipboard
Copied
Phil, you catch me again where Im at work and stuck at a CS2 box… I do most scripting from home where I keep my snippets… Your method of 'getInternalColor()' was only brought in with CS4 I jumped to CS5 only a short while ago and missed that one… Even so the older method I recall was looping all the art to find and swap out. Then remove the spots… Best I to go see if anything else has changed too before I say your preferred route can't be done…
Copy link to clipboard
Copied
Hi Mark,
Thanks for your reply.
I am not clear with your comments, can you elaborate me is there any possibilities of changing SPOT Color to Process CMYK by disabling GLOBAL Option?
thx
csm_phil
Copy link to clipboard
Copied
Phil, Im just about to set off for work now… but I ran a quick test on my home box and to my surprise this appears to work…
#target illustrator var myDoc = app.activeDocument; var spotcnt = myDoc.spots.length; for (var i = 0; i <= spotcnt-1; i++) { if (myDoc.spots.name!="[Registration]") { var spotname = myDoc.spots.name; var spotvalue = myDoc.spots.getInternalColor(); var mycolor = myDoc.swatches.add(); mycolor.name = spotname; var myCMYK = new CMYKColor(); myCMYK.cyan = spotvalue[0]; myCMYK.magenta = spotvalue[1]; myCMYK.yellow = spotvalue[2]; myCMYK.black = spotvalue[3]; mycolor.color = myCMYK; } } if (spotcnt > 0) {app.activeDocument.spots.removeAll();}
I've not been able to do this before so do check and let me know the result at your end… Does make things a little easier when you can read the values…
Copy link to clipboard
Copied
Hi Mark,
Sorry i am not yet got the exact reply for disabling GLOBAL Option while converting SPOT Color to Process CMYK.
Please conclude is it possible or not.
thx
csm_phil
Copy link to clipboard
Copied
Sorry, I don't see any property that lets you do that… This was about the closest to that I could find…
Copy link to clipboard
Copied
I tried the script and changed three Pantone spot colors to CMYK. When I checked the new color definitions in the .ai file they were no longer Global.
Copy link to clipboard
Copied
Larry, what Phil was asking for was a method where you could change a property of the color 'global' with scripting but this does not exist like it does in the GUI. What is posted copies the values to new swatches then removes the spots which kinda results in the same thing all be it a work about… At least you can read the values now…
Find more inspiration, events, and resources on the new Adobe Community
Explore Now