Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script to Change swatch CMYK values

New Here ,
Dec 02, 2008 Dec 02, 2008
Are there any scripts available to change CMYK values of swatches for files in CS3?

I have hundreds, probably thousands of Illustrator EPS files that use swatches all drawn from a total palette of maybe 50 colours.

Each colour is named and has a corresponding CMYK value.

I want to update the CMYK values for all ~50 colours that appears across all these documents. Is there some way I can simply change the CMYK spec of the swatches used by each of these documents by not having to manually open and change the colours etc?

Even a script would be good that could batch process the files?

For example:

File contains a swatch as a named colour like:

Fire Red spec'd as 0, 96, 99, 0

I want to automate changing the CMYK values for all files containing Fire Red to, say, 0, 98, 99, 0

Any ideas? I have searched Google for a couple of days.

Edit: the flavour here is Illustrator for CS3 - both Win and Mac.
TOPICS
Scripting
2.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Dec 02, 2008 Dec 02, 2008
Do you want to just change the definitions of the swatches, or do you mean that all the objects in the illustration with those swatches will be repainted using the new colors? The former is (relatively) simple, the latter more complicated.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 02, 2008 Dec 02, 2008
Hi try67

Well, the easiest way to explain it is as if I was going to do it manually:

I'd open each swatch and simply update the CMYK values for the named colour, close the swatch, repeat for the 4 - 5 other colours in that file, then close and save the file.

I don't want / need to repaint them manually because as I update the colours the program shows the updated preview which is all I need to do.

The files are mostly EPS, perhaps some AI files and possibly some PDFs. It will be done via Illustrator CS3 on a PC.

Cheers.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2008 Dec 03, 2008
As far as I could see, though, when you create a shape using a swatch and then deselect that shape and change the color definition of the swatch, the shape doesn't change its color... but maybe I was doing something wrong.

If the only thing you want to change are the definitions of some swatches, then it should not be a problem. Use the swatches collection and an external CSV file with the name and new definition for the swatch. You can call a swatch by its name. Scan all documents in a folder and apply the changes to them.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2008 Dec 03, 2008
Hi try67

This sounds very promising but I don't quite understand what you mean: "Use the swatches collection". Is this an add-on for Illustrator or an object to be added to a script? I googled that phrase but couldn't find anything about it.

Since we're in the scripting section, I assume the latter. 🙂 Are there any script resources out there that have a script to do this, ready to go?

Cheers.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2008 Dec 03, 2008
Hi Scott,

The swatches collection is the built-in programming object that contains all the swatches associated with a document. You can read about it in the Illustrator JavaScript Reference file. If you don't know how to create a script, or feel this is above your level of knowledge, may I suggest that you contact me by email (click on my username for the address), and we could discuss me making one for you. In fact, I've already created something similar to what you're after.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 04, 2008 Dec 04, 2008
Hi try67

I've since done some more reading and the docs that ship with Illustrator are very good as you've suggested. My programming / scripting skills haven't seen the light of day for probably 10 years, LOL, so yesterday I enlisted a local IT guy (a good friend) who's a wiz with scripting and he's working on a solution for me at the moment.

Many thanks for your offer. I might ask a few more questions here and there if that's OK.

Cheers.

Scott
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 05, 2008 Dec 05, 2008
Hi Scott,

Good luck! And feel free to ask more questions, here or privately.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 07, 2008 Dec 07, 2008
Scott,

If the swatches were not defined as Global Swatches at the time they were applied to objects, editing them will not cause the objects to update.

JET
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 15, 2009 Jun 15, 2009
LATEST

I understand EXACTLY what you mean as it's the same thing I need to do, and will probably need to do on future occasions.

Did you get anywhere with this problem?

I have designed a scheme for a textbook I am illustrating (this is what I do for a living and have been doing so for well over a decade using Illustrator).

All colours used in every illustration are based on 7 CMYK Global swatches, usually 100% tints but also 50% 75% and others when required.

Anyway I have done 100 illustrations already based on my template when I realize I'm going to have to darken the green by +10% cyan.

What I need is a script to change the definition of my global 'green' swatch in every document from 100Y 30C to 100Y 40C.

Actions won't do it.

Any suggestions?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines