Created
October 11, 2018 20:57
-
-
Save Scotchester/b2ca1b9cebe23566e3a11a5f43499aa1 to your computer and use it in GitHub Desktop.
An Adobe Illustrator script for resizing the first artboard of a document horizontally, to fit the width of the first item on the artboard, but leaving the artboard height the same
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#target illustrator | |
#targetengine main | |
var doc = app.activeDocument; | |
var artboard = doc.artboards[0]; | |
var art = doc.pageItems[0]; | |
var coordinates = art.position; | |
var desiredW = art.width; | |
art.position = [ 0, coordinates[1] ]; | |
artboard.artboardRect = [ | |
artboard.artboardRect[0], | |
artboard.artboardRect[1], | |
desiredW, | |
artboard.artboardRect[3] | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment