Illustrator: resize All artboards to the art present on themselves

This illustrator script selects the art on every artboard, and resizes the artboard to it.

For a batch rescale assignment (It ended up as 900 png’s) I needed a *lot* of artboards. Since the artboard tool in illustrator isn’t the best performer, even on modern hardware, this is what I ended up doing:

• Group the icons to rectangles without appearance, sized to the artboards.
• Duplicate the artboards to as many as are needed.
• Rescale the objects on them. Tweak where necessary, make sure extents are on whole pixels.
• Run this script
• Export using the wonderful “multiexporter.jsx”

This is a heavily modified version of a script I found HERE.

download the script HERE