I'm fairly new to InDesign scripting (and to scripting in general) and having a lot of fun :-)
I have a InDesign document containing several frames (text, graphics, etc.) and I tagged them using the Tags window of InDesign.
After a lot of struggle, I managed to get the tag name of the first XML element in my document using this simple code:
I will then probably use a for loop to get every markupTag of every xmlElement. But I have a lot of trouble to get the page item associated with the xmlElement :-/
After a lot of googling, I stumbled upon this article which is supposed to answer exactly my question. I tried to understand this code, copy-pasted it in ExtendScript, but I have to admit this is a bit too complex for me…
Can anybody tell me how to get a Graphic or Text Frame associated to my XML Tags? Any help is greatly appreciated!
Nevermind, I found an easier way to achieve what I was trying to do. I actually wanted to be able to manipulate the different frames in my document, hence why I wanted to use XML tagging.
For those of you that would have the same problem, know that since InDesign CS5, there's a itemByName method that allows you to select a frame by its name in the Layers Panel! So much easier to use :-)