Just doing some research on this on my own...I've found a method: "fitArtboardToSelectedArt()"...but because I'm using the document selection to loop through objects, I always have everything selected all at once. Is there possibly a way to save a selection, deselect everything, and select just one thing, then regain the selection again?
- loop thru selected objects and push the objects into an array
- set selection to null to deselect everything
- do your thing
- loop thru your object's array and restore selection
"I have everything selected…" It is better not to use selections where possible… If you want everything just loop pageItems? And to the OP you can loop almost anything chaning the artboard as you go… No need for ImageMagik