Hello!
This code works perfectly in Illustrator CS6 for Mac:
function resizeArtboard() {
app.redraw();
app.activeDocument.artboards[0].artboardRect = app.activeDocument.visibleBounds;
app.redraw();
}
It works like the menu option "Shrink artboard to fit content".
However, running this script in Illustrator CC for Windows, the result is different: the content is enlarged to fit the artboard instead.
How can I solve this?
Thanks in advance!
/Måns