• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Shrink Artboard to fit content

New Here ,
Jul 04, 2008 Jul 04, 2008

Copy link to clipboard

Copied

I've been searching everywhere for a script or plugin that will shrink the artboard to fit the content. Fireworks has a feature like that. Has anyone done this in Illustrator?

Views

68.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
New Here ,
Aug 05, 2011 Aug 05, 2011

Copy link to clipboard

Copied

Hi, I've been following this thread and have a similar issue.  I'm working in CS4.  I believe I have the right script to shrink the artboard to fit my content--thanks, everyone!--but now I'd like to automate the whole thing so that it will open, run the script and save.  I've got a few hundred very similar images here and obvs running the script on each individually is overwhelming.  I'm not clear why running a script cannot be a recordable action, but so it goes. 

Can someone please explain the basics of getting a code to do this?  I don't even know--would I run it in Script Editor?

Advice?

Thanks!

Trevor

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 05, 2011 Aug 05, 2011

Copy link to clipboard

Copied

Script Editor is Apple's AppleScript utility… The above code is JavaScript and its best to use the Adobe ExtendScript Toolkit to edit and save…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 05, 2011 Aug 05, 2011

Copy link to clipboard

Copied

Hi Mark,

I'm a dummy compared to this forum--So If I drop the code above into ExtendScript and run it, that will perform the task of the script I've identified...?

Thanks so much.        Trevor    

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 05, 2011 Aug 05, 2011

Copy link to clipboard

Copied

You can C&P from the post above… If you use the sample by Prepress then it should work with all open documents… Paste into a new document window in the ESTK from there you can test/run with Illustrator as the selected target… or you could save to file what ever you want to call it and file extension '.jsx' drop that in your Illustrator scripts and restart the app… I would have used visibleBounds over geometricBounds myself but hey ho each to their own…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 05, 2011 Oct 05, 2011

Copy link to clipboard

Copied

Document setup - Edit Artboard - then double click on image.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 09, 2013 Feb 09, 2013

Copy link to clipboard

Copied

I just tried the Artboard Tool. Shift-O, then double-click on the image. Save. Done.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 10, 2013 Feb 10, 2013

Copy link to clipboard

Copied

ALWAYS state the version you are using.

You are resurrecting a thread that started almost 5 years ago. In the current version (16), there is a command for fitting the artboard to artwork. That did not exist back then.

JET

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 21, 2013 May 21, 2013

Copy link to clipboard

Copied

The question wasn't about whether it's possible, it's about how to record that action into a script. When you record a script it does not record that step in CS5 or earlier. (Not sure if it does in later versions.) To do so you must choose (from Actions menu, as you're recording the script) Insert Menu Item and then choose from the menu Object [sorry I can't remember the name of the command and I don't have CS5 here] something like Fit to Artboard.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 21, 2015 Jul 21, 2015

Copy link to clipboard

Copied

CS6: Objects > Artboard > Fit to selected art

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 21, 2015 Dec 21, 2015

Copy link to clipboard

Copied

CS5: select artboard > objects > Artboards > Fit to artwork bounds

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 21, 2015 Dec 21, 2015

Copy link to clipboard

Copied

LATEST

I have not read every post in this thread. I routinely fit the artboard to the artwork by choosing "Edit Artboard" (Shift+O) and double-clicking the group or object I want to size the current artboard to. Works great (CS5). I'm sure this has already been discussed, just to lazy to read all the posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines