Copy link to clipboard
Copied
I have made artwork in Illustrator that is set up as two page spreads on 1 artboard.
I need to convert this to single page spreads.
I.e. So for half the documents, I need to set the anchor point of the document to top left and half the width of the artboard.
For the other half of the documents, I need to set anchor point to to right and half the width.
Is this possible with scripting?
I have look around online to find ways of accessing the document size and anchor point via scripting, but cannot seem to find any resources.
Thanks for any help that can be offered.
Edit: Also is it possible to create a new artboard with a script and assign it a name?
here you go, this script splits the artboard in two
...// carlos canto
// http://forums.adobe.com/message/5380624#5380624
var idoc = app.activeDocument;
var ab = idoc.artboards[0];
var abBounds = ab.artboardRect;// left, top, right, bottom
var ableft = abBounds[0]; // 0
var abtop = abBounds[1]; // 612
var abright = abBounds[2];
var abbottom = abBounds[3];
var abwidth = abright - ableft; // 792 // width
var abheight = abtop- abbottom; // 0 // height
var half = ableft + abwidth/2;
var abright2 = half;
ab.artboardR
Copy link to clipboard
Copied
Without a picture of the artwork its a little guesswork… I would suspect that you could change the existing artboard's rectangle or add a new one and remove the old…
Copy link to clipboard
Copied
Without a picture of the artwork its a little guesswork… I would suspect that you could change the existing artboard's rectangle or add a new one and remove the old…
Thanks for the reply!
I have found you can do this with doc.visibleBounds However, is it possible to create two artboards in one document with a script. E.g. so I can have one artboard for the left side spread and another artboard for the right side?
Thanks!
Copy link to clipboard
Copied
here you go, this script splits the artboard in two
// carlos canto
// http://forums.adobe.com/message/5380624#5380624
var idoc = app.activeDocument;
var ab = idoc.artboards[0];
var abBounds = ab.artboardRect;// left, top, right, bottom
var ableft = abBounds[0]; // 0
var abtop = abBounds[1]; // 612
var abright = abBounds[2];
var abbottom = abBounds[3];
var abwidth = abright - ableft; // 792 // width
var abheight = abtop- abbottom; // 0 // height
var half = ableft + abwidth/2;
var abright2 = half;
ab.artboardRect = [ableft, abtop, abright2, abbottom];
var ableft2 = half;
var newAB = idoc.artboards.add([ableft2, abtop, abright, abbottom]);
Copy link to clipboard
Copied
That's excellent, thanks!
Copy link to clipboard
Copied
Hi Carlos. I know this is a super old post, but I am using CS5 still 🙂
Could you help with this?
I am getting this error:
"error 21 undefined is not an object. var ableft = abBounds[0]; // 0"
Copy link to clipboard
Copied
oops just realized this was the wrong post. going to post on the other one.