Instead of app.activeDocument you can just use the shortcut property document.
Next, you've got an anchored object selected. Its parent is a character. And its parent is a story.
You access all the text frames that are part of a story with the property textContainers which returns an array. (story.textFrames will return any text frames that are anchored to the first insertion point of that story, basically useless.) But this won't really help you, because you may not know which frame the anchored object is in.
Instead, to get the textFrame that a character is in, go directly, using the parentTextFrames property: document.selection[0].parent.parentTextFrames[0].geometricBounds[3]
Sign up
Already have an account? Login
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inSign in to Adobe Community
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.


