The Magic Illustrator Script – Ai to iOS & Android
Create retina assets for iOS and Android in 1 click with this Illustrator Script
Here is an Illustrator script for designers who use Adobe Illustrator to create iPhone and Android Apps. It exports your art boards in all needed sizes with the right names and folder management. Name your Ai file correctly (say “Project”) as well as your art boards (say “VisualHomescreen”). When you run the script, it will export iOS files in a folder under the name: ProjectVisualHomescreen.png | For the Android files, it will create three different folders (one for each resolution) and name the files: project_visual_homescreen.png.
How to install
If you place the script in the Adobe Illustrator CS5/Presets/Scripts folder, the script will appear in the File > Scripts submenu.
If you place the script in another location on the hard disk, you can run the script in Illustrator by choosing File > Scripts > Browse.
How to use
Choose the folder where you want to save the files.
Optionally you can add a suffix to the files.
That’s it, all files will be saved with the appropriate names.
Notes
Locked layers visibility will be ignored and they will not be exported. This can be used to keep global layers visibility, like a background, or guide layers from being exported. This script is an improvement of Herkulano‘s script.
Great script idea -
Hi, I’m very excited to try this out, but before I download, one question first. Does it include iphone 5, and android ldpi? If not, can it be added? Could I edit the script?
Xavier -
It includes mdpi, hdpi and xhdpi for Android and regular + @2x images for iPhone. Yes you can edit the script
Matt -
Great script – really useful and saves me so much time.
One question – i have an ai doc with 2 art boards (active and on-tap state). Each art board has two elements (a background and an icon contained within), but they are all on the same layer. On using the script, only the background is exported. The layer is not locked.
What am I doing wrong?
Xavier -
Hello Matt,
Illustrator exports artboards only. You have to place each assets on a separate artboard and let the magic happen. I usually convert my elements into symbols to have a seamless update. Tip: use a rectangle shape with no fill or stroke to cover a bigger area or center your asset inside the symbol. Best.