Adobe Illustrator Script to Export Android and iOS PNG’s

Lucas Hall UX

I want to make this script available to anyone who might need to export Android and iOS PNG’s from Adobe Illustrator. Two days ago I got a chat from our one of our Costco Android developers. She had a complaint about the design document that I passed over to her. Her complaint was about the image package that I provided in the design document for an up-coming release of the Warehouse Details screen of the Costco Mobile App. Too large of images, strange pixel junk, and the wrong graphic file format. Names were in the wrong naming convention, and the produced file folder was wrong as well… It all added up to bogging her down.

The solution: Write my own Illustrator Batch Processing Script

At that, I immediately jumped in and coded the solution… just kidding. I actually started with research first. Very soon, I learned that Adobe has been very transparent about how to write your own scripts. As well, there are a number of resources out there. Looks like every version of Illustrator has it’s own quirks when it comes to coding. View Adobe’s api and scripting start page to learn how you can leverage your existing javascript know-how to get going. Here’s a tip: the file format that Illustrator needs is jsx.

What to expect

the script is pretty simple, but it seriously took some test, retest, retest, to get it so that it was producing the right results.

  1. Select an item on screen, such as an icon off to the side of an art-bard, in the canvas area.
  2. Run the script. You might need to navigate to the where you downloaded this file from.
  3. When the script starts, a popup appears that asks you to select where the export folders will go. Select a place.
  4. Next, you will be asked to select which sizes to export… Select the sizes you want. If you are in doubt, select them all.
  5. Click export. This will take a moment. I jut did 20 icons earlier today, and selected all check boxes which means that it ends up producing over 100 different images. It took about 2-4 minutes to do them all.
  6. Done!

Download ExportMobileIcons.jsx

Enjoy! ~Lucas

Share link via: