Copy link to clipboard
Copied
A scripting question. If I select any anchored object, I can get their position using this:
function main() {
var myAnchoredObject = app.selection[0];
if (!myAnchoredObject.hasOwnProperty("anchoredObjectSettings")) {
alert("The selected item does not support anchored object settings.");
return;
}
var posType = getAnchoredPositionType(myAnchoredObject.anchoredObjectSettings.anchoredPosition);
alert("Anchored Position: " + posType);
}
function getAnchoredPositionType(anchoredPosition) {
switch (anchoredPosition) {
case AnchorPosition.INLINE_POSITION:
return "INLINE";
case AnchorPosition.ABOVE_LINE:
return "ABOVE_LINE";
case AnchorPosition.ANCHORED:
return "CUSTOM";
default:
return "UNKNOWN (" + anchoredPosition.toString() + ")";
}
}
app.doScript(main);
But if the anchored object is a Flex Object, I always get this:
The selected item does not support anchored object settings.
So, is it possible to get the Anchored Object Setting of a FlexObject? Or Adobe forget to give access to this information in the ExtendScript API?
Hi @jctremblay
I'm afraid they simply forgot to implement the `anchoredObjectSettings` property on the `FlexObject` entity. (And this is far from being the only oversight…)
Best,
Marc
Copy link to clipboard
Copied
Hi @jctremblay
I'm afraid they simply forgot to implement the `anchoredObjectSettings` property on the `FlexObject` entity. (And this is far from being the only oversight…)
Best,
Marc
Copy link to clipboard
Copied
Thanks for confirming... That’s my conclusion after reading your blog post on Flex Object and searching the InDesign ExtendScript API Adobe InDesign 2026 (21.0.0.192) Object Model.
Copy link to clipboard
Copied
@jctremblay -- A flex object is not itself an anchored object. In some ways a flex object looks like a group. You can anchor a flex object in another text frame as usual though (grab the top-right solid blue rectangle and drag it into a frame), and then (naturally) it'll be a regular anchored object.
Sorry, I got that wrong. You're right, the flexObject object is lacking the anchoredObjectSettings property.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more