Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Does FlexObject expose anchoredObjectSettings?

Community Expert ,
Dec 27, 2025 Dec 27, 2025

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?

TOPICS
Scripting
120
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Dec 27, 2025 Dec 27, 2025

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
Guide ,
Dec 27, 2025 Dec 27, 2025

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2025 Dec 27, 2025

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2025 Dec 28, 2025
LATEST

@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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines