I have a indesign document, in this document I a stories with some text is "I have a sample text, This sample text is “sample“ ". In this text, I tag "sample" in second position. When I get contend of this stories by "app.activeDocument.stories.item(0).contents", with that, I check with this stories Is there xmlElement associate with it by using var xml = app.activeDocument.stories.item(0).associatedXMLElement.xmlElements . I have xml.length = 1 because I was tagged "sample" in this stories. My issues is I can't get position of "sample" I was tagged in stories content. I try to use indexOf but It only detect "sample" in first position. I also try to use storyOffset and InsertionPoint but not success. Could you please help me to resolve this solution.