I am trying to find out XML element name within the overset text, here below is the code.
Copy link to clipboard
Looking at the returned value of associatedXMLElements in the debugger, the following seems to work
Alternatively you can change your return value to the following
return textFlow.texts.itemByRange(start, textFlow.texts.characters[-1]).getElements();
Thanks it's helped!
thank you for bringing up this issue.
Amazing, that associatedXMLElements throws error 45 with message "Object is invalid" when the text is in overset.
Just tested that with InDesign 2021.
Is this a bug or as expected?
Hm. We could walk through all xmlElements and look for texts of every individual xmlElement.
You should be able to find the parentStory of the text and also if parentTextFrames returns an error which is an indication for overset.
Or: You are able, at least temporarily, to resolve the overset situation by adding text frames to the story or to change point size etc.pp.
( ACP )
Thanks Uwe for looking into it. I am not sure if it's a bug or not. The solution provided by Manan is working fine.