Copy link to clipboard
Copied
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
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…
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
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…
Copy link to clipboard
Copied
Document setup - Edit Artboard - then double click on image.
Copy link to clipboard
Copied
I just tried the Artboard Tool. Shift-O, then double-click on the image. Save. Done.
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
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.
Copy link to clipboard
Copied
CS6: Objects > Artboard > Fit to selected art
Copy link to clipboard
Copied
CS5: select artboard > objects > Artboards > Fit to artwork bounds
Copy link to clipboard
Copied
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.