Copy link to clipboard
Copied
Hi All,
I am trying to find out XML element name within the overset text, here below is the code.
Alternatively you can change your return value to the following
return textFlow.texts.itemByRange(start, textFlow.texts[0].characters[-1]).getElements()[0];
-Manan
Copy link to clipboard
Copied
Looking at the returned value of associatedXMLElements in the debugger, the following seems to work
alert(myXMLelem[0][0].markupTag.name)
-Manan
Copy link to clipboard
Copied
Alternatively you can change your return value to the following
return textFlow.texts.itemByRange(start, textFlow.texts[0].characters[-1]).getElements()[0];
-Manan
Copy link to clipboard
Copied
Thanks it's helped!
Copy link to clipboard
Copied
Hi Shonky,
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[0] of every individual xmlElement.
You should be able to find the parentStory of the text and also if parentTextFrames[0] 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.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
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.
Thanks,
Shonky