Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to make an Illustrator script run over all files in a certain folder and perform operations on these?

I am using CS5 on mac.

share|improve this question
What exactly are you trying to do? Also, please indicate what version illustrator you are using. You should look into Batch/Actions for Illustrator. If you can explain what you are doing you could script a process in a shell script per ImageMagick or similar. – Darth_Vader Mar 14 '13 at 15:26
up vote 2 down vote accepted

There are different ways to achieve what you're after. You just have to decide what works best for your workflow/platform.

  1. Have the script assign all *.ai files in a given directory to an array, then loop through.
  2. If you're on OS X, set up an AppleScript droplet that will do the same as option 1 for any directory dropped on it.
  3. Create a file prompt at the start of the script with multiple select enabled. This can be done with AppleScript, but I'm not sure about js.
  4. Not exactly what you described but, the script could assign all open docs to an array. This way you wouldn't be limited by directory.
share|improve this answer
5. make a script that acts upon and then closes an open file; create an action that runs the script; batch the action on a folder – horatio Mar 14 '13 at 20:03
@horatio sounds like a good alternate answer – user568458 Mar 16 '13 at 14:30
Thanks - ended up using #1 which worked well! Only issue I stumbled on was that I had to replace 'file://' with '/' on Mac Mountain Lion for the folder path – shaun Apr 2 '13 at 4:29
Yeah, file:// is a URL, you need the POSIX path for this purpose. – plainclothes Apr 2 '13 at 23:23
So how exactly do I modify an existing script to: Have the script assign all *.ai files in a given directory to an array, then loop through? – conceptoftheday Apr 28 '14 at 3:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.