Resize Artboard in Adobe Illustrator CS5

Hi,

Can someone help me with the script to resize the page/Artboard in Adobe Illustrator CS5.

Currently the page size is 77mm x 77mm (width x height)

New desired size should be 100mm x 100mm (width x height)

Also need to know how to change the units to mm

Thanks

Volià …

tell application "Adobe Illustrator"
	set newWidth to 350
	set newWidthPoints to newWidth * 2.834645 -- (1 millimeter = 2.834645 points)
	set newHeight to 148.5
	set newHeightPoints to newHeight * 2.834645
	set artboard rectangle of artboard 1 of current document to {0.0, 0.0, newWidthPoints, -newHeightPoints}
end tell

Stefano - Ame

Hi Ame,

Thanks, the new size is shifting downwards leaving the objects on top pasteboard area.

Can we change the preferences to mm instead of doing calculations in script

Hi,

Reading documentation “seems” that Illustrator works in points so you have to manage conversions.

Stefano - Ame

Thanks, and what about resizing the artboard from the middle. As per current script the artboard shifts downward leaving the objects on the pasteboard (top of the artboard)

The current size of the artboard is 77 mm

Please advise

Hi Ame,

Any idea how to change the size of the document from the middle of the current page, keeping intact the page elements on the page after resizing.

I mean to say that the page should increase from all the four sides.

As per the current script the new size is shifting downwards leaving the objects on top pasteboard area.

Moreover, please advise what these coordinates are i.e what is top, left, right, bottom?
{0.0, 0.0, newWidthPoints, -newHeightPoints}

Please advise.

I checked the AI Dict and “seems” that there is no way to define the anchor point of the new bound of the page like for example in Photoshop using the command resize canvas (in reply to your post about split image).

Stefano - Ame

Thanks Ame,

Can you please advise regarding the coordinates. Am I guessing right?

i.e what is top, left, right, bottom?

{0.0, 0.0, newWidthPoints, -newHeightPoints}