Let me preface this with the fact that I'm fairly new to InDesign.
Let's say I have a rectangle on the page. The page's Anchor Point is set the the center. I'd like that to remain unchanged, however, I would like to put new geometric bounds on the rectangle with a different Anchor Point.
I thought something along the lines of:
var item = myDoc.pageItems;
item.ChangeObjectProperties.anchorPoint = AnchorPoint.BOTTOM_CENTER_ANCHOR;
However, it says that "item" does not support the ChangeObjectProperties method.
What can I do?
Page items don't have anchor points; neither do pages. The layout window has a transformReferencePoint which controls the anchoring for transformations in the UI. If you're assigning a new geometricBounds to a page item, you're essentially defining the coordinates of all four points of the bounding box, so anchoring doesn't really come into it. If you want to, say, double the height of a box but leave its bottom where it is, you can use the resize() method:
item.resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.BOTTOM_CENTER_ANCHOR, ResizeMethods.MULTIPLYING_CURRENT_DIMENSIONS_BY, [ResizeConstraints.KEEP_CURRENT_VALUE, 2]);
Transformations in InDesign are hard, though; I certainly don't fully understand them. It's usually easier to just do all the arithmetic you need to to come up with a new geometricBounds for the page item.
Thanks so much! Yea, I guess that was the method I was looking for