Copy link to clipboard
Copied
Is it possible to batch process eps files, which were created in Illustrator, and save them as ai files?
Is it possible to batch process Illustrator files to change the color definitions of a couple of swatches in the Swatches panel throughout those files?
Copy link to clipboard
Copied
Here's one that will save as AICS4
-- BEGIN CODE
set fileTypes to {"EPSF", "PDF ", "ART5", "TEXT"} -- file types available to resave as Illustrator
-- get a sourceFolder that holds the files to resave as AI
set sourceFolder to (choose folder with prompt "Choose a folder with files to resave as Illustrator:") as text
-- get a list of files of the defined type in the sourceFolder
tell application "Finder" to set workingFiles to (every file of folder sourceFolder whose file type is in fileTypes) as alias list
-- now you have your fileList argument
-- get a destinationFolder to hold the PDFs
set destinationFolder to choose folder with prompt "Choose a folder to hold the Illustrator files:"
SaveFilesAsIllustrator14(workingFiles, destinationFolder)
on SaveFilesAsIllustrator14(fileList, destinationFolder)
set destinationPath to destinationFolder as string
repeat with aFile in fileList
tell application "Finder"
set fileName to displayed name of aFile -- get displayed name
set AppleScript's text item delimiters to "."
set newFileName to text item 1 of fileName
set newFilePath to destinationPath & newFileName & ".ai"
end tell
tell application "Adobe Illustrator"
open aFile forcing CMYK with options {update legacy text:true}
save current document in file newFilePath as Illustrator with options {class:Illustrator save options, embed linked files:true, PDF compatible:true, font subset threshold:0.0}
close current document saving no
end tell
end repeat
end SaveFilesAsIllustrator14
-- END CODE
You can add other options in the list as needed. You can also look in the CS4 Sample scripts file for an Edit Swatch which you might be able to integrate into the above between opening the file and saving it.
Copy link to clipboard
Copied
Larry,
Thank you so much for your suggestions.
I found the CS4 sample script you mentioned, EditSwatch.jsx. However, I'm uncertain how to use the script. When I select the script from the File > Scripts menu, a new file is created with a polygon that has a purple fill and black stroke -- it doesn't give me any options to change the colors.
What needs to be done is:
Batch process a bunch of Illustrator EPS files. Each EPS contains two custom colors which need to be changed to standard PMS colors. The files can remain as Illustrator EPS files for this process. I would greatly appreciate knowing what the code would be in order to accomplish this.
Copy link to clipboard
Copied
Although I'm not knowlegable about JavaScript, I opened the Change Swatches script in a text editor. I understand the first part which identifies which color to change in the Swatches panel by the order it appears in Swatches. But the second part of the script changes the color to a CMYK color and I need a Pantone color. Can the script be edited so that it can change a custom spot color to a standard Pantone color? Can it be edited to change 2 colors (instead of just one at a time) in Swatches to different Pantone colors?
As I mentioned previously, I need to change two custom spot colors to standard PMS colors, and there are a ton of Illustrator EPS files that need this change. I'm desperate to find a solution to this, and would be extremely grateful if you can help.
Copy link to clipboard
Copied
Adding to my last message, I've also tried using the Actions panel in Illustrator CS4, but it doesn't seem to be robust enough for this procedure.
Copy link to clipboard
Copied
Jay, Larry posted an AppleScript but you also mention a JavaScript. Just to clear things up are you on Mac OS where either language solution 'should' work? The only method that I've been able to this with Illustrator is to save a clean .ai document like those used for symbols, graphic styles, brushes etc. containing the pantone color swatches that I want to bring in and duplicate an object with style/color applied from one document to another. Unfortunately Illustrator does NOT have a swatches merge like ID or import color books. (Unless Im overlooking something in my guides?)
Are the docs in question simple n clean?
Copy link to clipboard
Copied
Muppet Mark,
Thanks for your reply. I work on both PC and Mac. JavaScript would be more versatile, but I'd love to have any script (JavaScript or AppleScript) to accomplish this would be wonderful -- I could use either to get the job done. Question is -- is there a JavaScript or AppleScript that will change the colors from custom spot to PMS? From what you say, it doesn't sound like one is possible.
While Illustrator doesn't have an "import color books" command, in the flyout menu of each Pantone color library there is a "Persistant" command. Choosing that will cause that Pantone color library to display when an existing Illustrator file is opened or a new one is created. That, however, doesn't help much because even though the panel is open, it would still require many steps to replace the old swatches with the new ones -- unless either a JavaScript or AppleScript can do the job or at least the bulk of the job.
As I mentioned, I don't do scripting. The Change Color script provided by Adobe seems like it might be helpful, but it changes a color to a CMYK and I need PMS spot colors. Perhaps someone knows a way to edit it so that it changes an existing color to PMS color.
Copy link to clipboard
Copied
I will have to go check this as I have my PMS swatches set to persistent in the app but these are separate from each documents swatch pallet and Im almost certain that scripting does NOT have access to these. (Not everything that is available to an app in the GUI is accessible thru script).
If your artwork files are NOT too complex it may be possible to iterate thru the objects and change the color, but I don't have a great deal of experience with this (still doing the learning bit).
Copy link to clipboard
Copied
Muppet Mark,
Thanks for taking this problem under consideration. If scripting doesn't have access to the PMS panel, your copy/paste idea could be used instead. If a script could swap the custom colors with the new PMS colors, that would complete the process. It would be great to have a script that would do a batch process from beginning to end, but automating even part of the process would save a tremendous amount of time.
Copy link to clipboard
Copied
Jay, any chance you could post a sample file? It need not be a work file but set up in the same way… Would need to be CS2 Im stuck with being behind the times… I have not gotten as far as JavaScript that is PC compatible yet either (never had the need just yet).
Copy link to clipboard
Copied
I can help you via applescript, but need to get on another MAC at come point. It may be this evening. The only issue I can find at this juncture is that the Applescript will not recognize any color in the palette that is not global. And, of course, the colors need to be in the palette to be edited. You can add the colors as part of your script if they are not already in the palette yet are in the file by using the actions and incorporating them in the script.
Please LMK your OS, CS version, etc.
Copy link to clipboard
Copied
Kathlene,
Thanks for your offer to help. Muppet Mark developed a Javascript that changes colors; it doesn't include changing from EPS to AI.
The colors I'm using and want to replace are global colors, and they are in the Swatches panel. The replacement colors are not in the Swatches panel. I'm using Leopard, and CS4. Is it possible to do batch processing of scripts in Illustrator so that I can convert multiple files at once?
Copy link to clipboard
Copied
Look in the CS4 Scripting folder under Sample scripts>JavaScript. In the Miscellaneous folder is one that will make PDFs. Just change the PDF Options to ones for AI and away you go. Look at the AI Save Options in the Javascript Reference file to see what ia avialable. List them here and I'll try to make it work.
Copy link to clipboard
Copied
Sure it is - I am not Javascript, but can help out with Applescript. Can you PM me so I can get a sample of the file you are working with? Just need to know if these colors will be consistent between files.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now