Skip to main content
Participant
June 1, 2019
Question

Automate changing colours, saving, and exporting existing file in Illustrator

  • June 1, 2019
  • 1 reply
  • 3176 views

I have dozens of two-colour icons, and I would like to save several versions of each icon with different colours (black + variable colour). I figured out how to use Actions to automate the process of changing the colours, saving the files, and exporting the files to the appropriate folders, but two things are making the process still quite slow:

  1. I have to select the specific objects whose colour I want to change, and
  2. In each document, I have to move the new colour swatches from my Library or the Swatch window to the Properties/Appearance window in order for the Illustrator Action to be able to find the swatches to apply the colour change.

I would rather not have to do this for every file - it's very time-consuming! There must be a way to automate these tasks, perhaps using scripts? I'm kind of new to this, so any help would be appreciated!

Thanks.

This topic has been closed for replies.

1 reply

Stephen Marsh
Community Expert
Community Expert
June 2, 2019

Have you looked at Edit > Edit Colours > Recolor Artwork?

See if this helps for an action based method:

Re: Fasted way to Copy Graphs from Excel to Indesign using CMYK colors

It is better to use global swatches than manually applied colour values. You can record the place command on a file to bring in the swatches from a file containing all required swatches. Using the attributes/notes the action can remove the placed file after you have used the required swatches.

As actions are linear, you just need to logically plan out each step.

Scripting is a lot harder.

Let the forum know how you go.

arfayekAuthor
Participant
June 2, 2019

Hi Stephen! It took me a while, but I finally figured it out with your help!

I got stuck on how to be able to enter the colours directly instead of relying on swatches - I finally realized I have to shift-click on the fill colour in the Appearance panel so I could enter the hex code and have it recorded as a part of the action. So I used your "rectangle method," as shown in the screenshot.

And then I repeated the sequence for each colour. I used the Batch function to apply it to every logo file I needed to change, and voila! A new AI file and PNG file for each different colour version, all organized in separate folders. I used Powershell to change the file names according to their colour.

I couldn't figure out how having global swatches helped, or how to use your suggestion of placing a file with all the required swatches, however. But I did get it to work!

Thanks!

Stephen Marsh
Community Expert
Community Expert
June 2, 2019

I'm glad that my action suggestion worked for you!

The reason that I suggested using global swatches is that this is best practice/good form for potential edits at a later point in time. Rather than selecting objects, all you need to do is change the global colour swatch and all objects that use that swatch are automatically updated.

If you have setup swatches as spot colours, you can easily record the place command to place an Illustrator file containing these spot colour swatches into your file, they will then populate the swatches into your target document. You can then clear/delete the placed file directly after placing as it has achieved its purpose.

If your swatches are not setup as spot colours, then you would need to edit the placed file, copy/paste etc., similar to the screenshot below:

The appearance panel is one of those "keys" to using Illustrator at it's full potential, however you should also be able to use the color panel as well to apply direct colour values to a selected object (however I believe that global swatches are better).