var docRef = app.activeDocument;
app.coordinateSystem = CoordinateSystem.ARTBOARDCOORDINATESYSTEM;
var ab = docRef.artboards[0];
if ((((ab.artboardRect[2] - ab.artboardRect[0]) / 72) == 17) && (((ab.artboardRect[1] - ab.artboardRect[3]) / 72) == 20)) {
// do nothing
}
else {
docRef.artboards.add( [575,1601.78,1799,161.78] );
docRef.artboards.remove(0);
var abIdx = docRef.artboards.getActiveArtboardIndex();
var actAbBds = docRef.artboards[abIdx].artboardRect;
}
I want to say it works about 90% of the time. I have no idea why it doesn't always work, sometimes it will build the other artboard even though it is the correct size and I have no idea why. It is very frustrating haha. If anyone has an idea why it won't always work, please let me know. Thanks in advance!