Need help with my icon design workflow. Scaling artwork to fit its parent artboad and center.
I commonly need to export icons at a specific size (usually 16x16px). My typical starting point looks like this (I usually have more icons, but I've simplified things for the sake of this example):
Since I can't find a plugin or script that both resizes artwork to a bounding box of [n x n] (where "n" is an arbitrary pixel size WHILE maintaining each icon's aspect ratio) and then arranges each item in a grid - I do it all manaully. I just drag each icon roughly within each of my predefined artboards. This leaves me here after a minute or two of dragging:
Once I've gotten to this point, I use an action that centers a selected object to its parent artboard. I've set the hotkey to F2 so I can rapid fire. Click on icon > F2, Click on icon > F2, Etc. Repeat until all icons are centered.
Lastly, since some of the icons are smaller than my 16x16 artboards, I have to scale them to fit perfectly within the bounds of each artboard. Again since I don't have a working script that fits selected artwork to its artboard without aspect ratio distortion, I do this all manaully. After all this is done, I finally end up here:
So after outlining my current workflow, I am looking for any of the following:
1. A working JSX that will resize all selected objects to a bounding box of my input (I.E. 16x16, 32x32, 64x64 etc.) without breaking aspect ratio.
2. A working JSX that will scale up (or down) selected artwork to fit its parent artboard without breaking aspect ratio.
3. A working script that will center each individual icon (in one run of the script) within its parent artboard (to be performed after the resize)
4. Bonus points for a script that will roghly align each icon to a grid so I spend less time separating imported icons.
5. Any other tips or suggestions on how to streamline this workflow would be hugely appreciated!
Scripts I've tried:
- Carlos Canto's Fit Object To Artboard v2 (Doesn't keep aspect ratio)
- AiFitToArtboard.jsx (https://gist.github.com/ruandre/7b47cbf2a4c55dac9adb)
- This script posted here: https://community.adobe.com/t5/illustrator-discussions/script-for-making-an-object-the-artboard-size/m-p/3955376#M10915
- This script: https://pastebin.com/AY7cvuQw (This is the closest to what I need, but it's buggy and doesn't place the resized artwork within its artboard. But it DOES resize it correctly!)
Sorry that this post is extremely long, but I really want to find better solutions. My current workflow is unnecessarily tedious and I'm sure there are scripts or plugins that can help.
Thank you generously for any tips, scripts, guidance, or general help!
Jay

