Skip to main content
jctremblay
Community Expert
Community Expert
Dec 27, 2025 4:58 PM UTC
Answered

Does FlexObject expose anchoredObjectSettings?

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?

Marc Autret
Marc AutretCorrect answer
Legend
Dec 27, 2025 6:25 PM UTC

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

3 replies

Peter Kahrel
Community Expert
Community Expert
Dec 28, 2025 8:34 AM UTC

@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.

Translate
Marc Autret
Marc AutretCorrect answer
Legend
Dec 27, 2025 6:25 PM UTC

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

Translate
jctremblay
Community Expert
Community Expert
Dec 27, 2025 6:32 PM UTC

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. 

Translate