I was wondering if there is a way to get the width and height of each specific page. I want to do this other than using documentPreferences because each of the pages I created are a different size and I believe just checking the documentPreferences will give you the default size to make a new page.
The short answer is:
var pgBounds = myPage.bounds; var width = pgBounds - pgBounds, height = pgBounds - pgBounds; // results are in current user's rulers units
The safe answer is:
var pgTopLeft = myPage.resolve(AnchorPoint.topLeftAnchor, CoordinateSpaces.innerCoordinates), pgBotRight = myPage.resolve(AnchorPoint.bottomRightAnchor, CoordinateSpaces.innerCoordinates); var widthInPoints = pgBotRight - pgTopLeft, heightInPoints = pgBotRight - pgTopLeft; // results are in points (whatever the UI) and are *not altered* by any page transformation