2 Replies Latest reply on Jun 23, 2014 12:15 AM by Mansb

    Resize artboard to content - works in Mac (CS6), not Win (CC)

    Mansb

      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