I need help to make a script that converts a process color swatch in Illustrator to a ‘Global’ process color (so its properties are defined as a spot color - even though it remains a process color).
I know how to do it the other way around, by using the line:
tell application “Adobe Illustrator”
“set color type of (spots of current document whose name is not “[Registration]” and its color type is spot color) to process color”
end tell
but so far - I’ve just been beating my head against a big wall with “Applescript” graffiti’d on it !!!
Well, this is as far as I’ve got trying to solve this mystery:
tell application "Adobe Illustrator"
tell document 1
repeat with currentSwatch in (every swatch)
get properties of currentSwatch
try
set properties of currentSwatch to {{color:{class:CMYK color info}}} --spot color info
--unquote the following if you'd like to see the error
--on error theError number theErrorNumber
--display dialog (theErrorNumber & " : " & theError)
end try
end repeat
end tell
end tell
For some weird reason, it doesnt work. I guess such a simple task that we’ve been doing for ~20 years didnt deserve a simple command from the programmers at Adobe… At least this will get you the properties of all the swatches in your document, it’s a step further. Let us know if you end up getting a result.
Good luck!
Browser: Safari 531.9
Operating System: Mac OS X (10.6)
This is a bit of a tricky one, but heres something that you can pick the bones out of.
I’ve got to share some credit though here, this is mainly from a script i got from somewhere else i didn’t write the majority of it, it did convert spot colours to process hence the variable names which i haven’t changed, but i’ve tweaked it hopefully to do what you want.
Its doing pretty much what shane suggests.
Best let us know how you get on with it.
tell application "Adobe Illustrator"
tell document 1
set t to name of every swatch whose class of color of it is CMYK color info
set m to choose from list t with prompt "Pick one or more colours to convert:" with multiple selections allowed
if m is false then return
my convertSpotSwatchesToProcess(m)
end tell
end tell
on convertSpotSwatchesToProcess(list_of_swatches)
tell application "Adobe Illustrator"
tell current document
set replacementSwatches to {}
set deleteSwatches to {}
set cmykSwatches to every swatch whose class of color of it is CMYK color info and name is in list_of_swatches
repeat with thisSwatch in cmykSwatches
set swatchName to name of thisSwatch
set swatchColor to color of thisSwatch
copy {name:swatchName, color:swatchColor} to end of replacementSwatches
set end of deleteSwatches to thisSwatch
end repeat
delete deleteSwatches
repeat with thisReplacement in replacementSwatches
make new spot at end with properties thisReplacement
end repeat
end tell
end tell
end convertSpotSwatchesToProcess
You will have to run a few tests (I think). If your art was set up using ‘global’ colours then you have the ability to change the colour values and this is reflected though out the artwork it is applied to (without the need to find it). I think that although you have iterated through the swatches and changed their type to spot. All associations with the art are broken?