Skip to main content
Participant
November 12, 2011
Question

Color Swap Between Libraries: Is this Possible?

  • November 12, 2011
  • 2 replies
  • 3112 views

I work with a large number of Illustrator files daily that all use the Pantone Solid Coated library for their swatch color scheme. This color library will be used whether customers provide the art pieces or if I design the pieces for them.

However, I have found that in order to best match our digital press we must to convert the inks to the Pantone Color Bridge CMYK PC library before printing. 

Basically the same color number just the different library (eg  PMS 200C would convert to PMS 200PC if outputing in-house to the digital press).

My question - is it possible to create a script that would swap out all the colors in a document (that are in a specific library) with the same colors from a different library?

*More specifically what I am wanting to do is if I have a document that has a dozen solid coated colors swap them for their same numerical equivelant in the Color Bridge CMYK PC library.

- Thanks

This topic has been closed for replies.

2 replies

Known Participant
February 26, 2014

It is now 2014 and I need this exact same scripting ability. I need to change a square filled with Pantone Coated to Pantone Bridge Coated. Is this yet a scripting possibility?

Participating Frequently
February 26, 2014

Depending on how much work you're trying to save, this script might help. The difficulty lies in that you have to break down the new Pantone into CMYK values to be able to script the color change. I created this script to swap out a Pantone swatch in over 100 files for me. So it's probably not worth the effort for just a few files, but for a larger batch it could be helpful:

var myOriginalColor = "PANTONE 1395 U"; //The name of the swatch you want to change

 

var myNewColor = "PANTONE 620 U"; //The name of the color you are swapping in

var myNewColorDetails = new CMYKColor(); //CMYK values for the new color

 

myNewColorDetails.cyan = 44.5960164070129;

myNewColorDetails.magenta = 40.0823950767517;

myNewColorDetails.yellow = 81.8265020847321;

myNewColorDetails.black = 14.1054391860962;

  

var myDocument = app.activeDocument;

   

var myNumberSwatches = myDocument.swatches.length;

  

    for (var j=0; j<myNumberSwatches; j++) //Checks to see if my new color already exists as a swatch and deletes it if it does exist

        {

            var mySwatchIndex = myDocument.swatches;

               if (mySwatchIndex.name == myNewColor)

                {

                    var myCheckSwatch = myDocument.swatches.getByName(myNewColor);

                    myCheckSwatch.remove();

                    j = myNumberSwatches;

                }

         }

    var mySwatch = myDocument.swatches.getByName(myOriginalColor); //Grabs the swatch that is being replaced

    mySwatch.color.spot.color = myNewColorDetails; //changes the swatch to the new color

   

    mySwatch.name = myNewColor; //renames the swatch to match its color

Known Participant
February 27, 2014

Thank you Josh.

You nailed my problem when you stated that "the difficulty lies in that you have to break down the new Pantone into CMYK values to be able to script the color change".

What I am manually doing is filling a line of squares with (first square) a Pantone Spot Coated color, and then the following squares with the CMYK mix from the various Pantone libraries attempting to find the closest CMYK match (visually) [second square is the straight mix of the original Pantone Coated color, third square is the Pantone Bridge Coated CMYK mix for same color, fourth square is the Pantone Bridge Uncoated CMYK mix for the same color]...I'm doing this using both the Pantone libraries used for CS5 (which includes a European mix) and CS6. (The color bridge numbers can vary between CS5 and CS6, ergo, more possibilites to match the color visually)

This is time consuming manually, but a good number of CMYK mixes to visually compare to a pre-printed sample I'm trying to match. I have multiple samples I'm trying to match. Since all the mixes involve using the provided Pantone libraries in Illustrator, I thought there might be a way to do this by scripting.

It appears that's not possible since scripting doesn't seem to be able to open a library and choose a swatch using the same Pantone number.

CarlosCanto
Community Expert
Community Expert
November 12, 2011

yes, it is possible, I mean, it seems possible...do you mind posting a file I can play with? CS4 if you can, please.

ChuckB39Author
Participant
November 13, 2011

Thanks Carlos.  Here are a couple links. I am at home so I dont have access to art files but I can make a couple example files up real quick just for you to play with with the colors, etc. and also get a better idea visually of what I am referring to.  Both files are identical when it comes to the objects, shapes, etc that they contain - same with what I am experiencing at work - except they will be a lot more complicated. 

http://www.megaupload.com/?d=ET2NZ73G  - this one contains all Pantone Coated Colors

http://www.megaupload.com/?d=NZKW6MXE  - this one contains all Pantone Color Bridge CMYK PC colors

Again what I am wondering is if there is some way to create a script that could do a find and replace of sorts - if you open these two files you will see what I mean.   I definitely appreciate the assistance here.

CarlosCanto
Community Expert
Community Expert
November 14, 2011

Hi Chuck, I was half way with the script...when I thought.....can't we use recolor?

see if this works for you

- select all your art

- click on "new color group..." in the swatches panel

- add your "cmyk pc" swatches, select them all and make another group

- rearrange the colors so they match the same positions as the "coated" group

- with all your art still selected, go to Edit->Edit Colors->Recolor Artwork...

- click on the "cmyk pc" color group on the right

- click ok, and presto