I have an Illustrator document with hundreds of vector images (each a color variation of a single image). Each vector image is on a separate layer. I have created an action to resize and export (save as png). Currently I have to apply this action manually for each layer. If 100 layers => click Action play button 100 times. Is there a way to create a batch action to perform an action on all layers in an Illustrator document with one click?
I'm answering my own question, since I found a solution.
Based on Scott's suggestion (in a comment to the question) to use scripting, I found a script that helps export each layer as a raster image. The script, called "Batch Export Unlocked Layers" is written by John Wundes. The script is hundreds of lines and too long to post here but I'll link to the download here (main site is www.wundes.com, in case of future link rot).
How to use:
I tested it in Illustrator CS4 and it exported 300 layers in less than a minute.