»
S
I
D
E
B
A
R
«
Batch SWF Conversion with AIR and Illustrator CS4
July 16th, 2009 by Richard Bates

Something that comes up pretty often for me as a Flex developer is the need to have artwork in SWF format.  For instance, I am working on a graphics app right now and I wanted to include vector clipart. I have loads of it, but its all in Illustrator (.ai) or PostScript (.eps) format.  The easiest way to deal with these formats is in Illustrator.  But they need to be SWFs for maximum benefit in my AIR app. Opening them and exporting to SWF one-at-a-time is totally unreasonable, as I have about 350 files I want to use. So, I started trying to think of a way to script Illustrator to convert them.  I remembered seeing something to allow interaction between AIR apps and CS3/4 apps on Adobe Labs.  After some Googling, I was able to locate Switchboard.  Basically, Switchboard allows you to call ExtendScript scripts from AIR applications.  Now, I have never used ExtendScript before, but I did manage to find a sample script called ExportFilesToSWF (installed with Illustrator CS4), which provided a good starting point.  The script is actually JavaScript, so before long, I had customized it to my needs.  The cool part is that Illustrator can convert a dozen formats including MS Word to SWF.  So, with a little ActionScript, I was able to create an AIR application that converts all the files in a directory to SWF using Illustrator.  You can choose the source document formats you want converted in the AIR app UI.  The resulting SWFs are saved to a “/converted” subfolder of the source directory.  I have not tried this on Windows, but it should be OK.  Please let me know if there are issues and I will post a fix.  To restate the obvious, you MUST have Illustrator installed for this to work.  You must also install SwitchBoard for end-users so the AIR application can communicate with your Illustrator installation.

AIBatchConvert - AIR Installer (Converts to SWF ONLY! I’ll add more scripts as requested)


One Response

Quick Illustrator tips: Create a ribbon; batch convert | Photoshop Life writes:
July 19th, 2009 at 3:27 pm

[...] developer Richard Bates has created a free utility & notes on Batch SWF Conversion with AIR and Illustrator CS4. [Via David [...]

Leave a Reply

»  Substance: WordPress   »  Style: Ahren Ahimsa
© 2008-2009 Richard Bates