Illustrator CS5 re-size and re-position artboard

Hi

Is there a way to centre an artboard to a graphic. In other words instead of moving the artwork on an artboard, is it possible to move the artboard instead.

I have written a script to move the graphics and it works fine. However, to do this I have to get the script to select every page item in the document. On some jobs this can take the script about 5mins (depending on the complexity of the graphics).

So I thought it would be quicker to move the artboard around the graphic instead.

Any ideas?

Thanks

You can set the position and size of the artboard with:


tell application "Adobe Illustrator"
	tell document 1
		set artboard rectangle of artboard 1 to {10.0, 20.0, 30.0, -40.0}
	end tell
end tell

You also have the app command to fit the artboard to selected art. or supply the visual bounds as list.

Thanks Guys.

But what I am after is a way to re-size the artboard around the artwork, which varies in size from job to job.

tell application "Adobe Illustrator"
	tell document 1
		set vb to visible bounds
		set artboard rectangle of artboard 1 to vb
	end tell
end tell

Perfect!

Simple when you know how eh!? :slight_smile:

Thanks.