you can anchor graphic frames to text. And you can move around text frames in your document. The anchored frames will move along. What you cannot do: Anchor a graphic frame so that it is visible on one spread but it is anchored to a text on a different spread.
That are some basics. I have no idea what you exactly like to do.
Show some screenshots with a before and after situation.
And explain better, please. What do you mean by "same page" for example? "same" like what?
( ACP )
Thanks for your reply!!
My question is very simple. InDesign document has the image without an anchor. So we need to provide the anchor to near text (same page or spread) using script.
let's assume you want to anchor a rectangle to a text insertion point.
Study the method insertAnchoredObject() of the anchoredObjectSettings of a rectangle object:
Basically you need an insertion point and the rectangle, that contains the image you want to anchor.
Let's assume you selected the text frame with the mouse first and added the rectangle to your selection.
Then the following will work:
var myTextFrame = app.selection; var myInsertionPoint = myTextFrame.insertionPoints; var myRectangle = app.selection; myRectangle.anchoredObjectSettings. insertAnchoredObject ( myInsertionPoint , AnchorPosition.ANCHORED );
( ACP )
// EDITED CODE: AnchorPosition.ANCHORED is needed instead of AnchorPosition.Anchored.