Hi all, I need to find the selected paragraph XML Element Name. I tried doing it, but i'm not getting the selected paragraph exact Tag instead i get the parent element of that Paragraph . The code i have tried
set EleName to name of markup tag of item 1 of associated XML elements of item 1 of characters of mypara
For instance, my paragraph
The selected paragraph's Tag is 'para'. Also I need to get the structure as 'chapter-section-para', but i'm getting only 'chapter' as XML Tag. If atleast i get only 'para' as Tag for my paragraph it would be better instead of getting entire structure as above mentioned. How to get this thru Apple Script. Anyone pls help me to get this?
tell insertion point 2 of character 1 of paragraph -1 of story 1 of document 1
set myXMLElements to associated XML elements
set myMarkupTag to markup tag of item 1 of myXMLElements
display dialog (name of myMarkupTag) as string
Once you have the XML element containing the text, you can get the parent XML element(s) of the element to get the entire structure.