Get textFrame's Tag/Label through script
Hello everyone,
I'm really sorry if this has already been asked, I have found discussions that touch on it, but haven't found any suggestions or solutions.
I am a web developer, with no inDesign experience, our graphic designer uses it to build our flyers.
We have been talking about translating the flyers to another language, and I have been working on making them interactive (with an image map)on our website.
If I'm going to suggest we revise the flyer structure for automating the translation, I'd like to also handle the image mapping (pulling image + area coordinates)
The thought was to write a js script that will pull the text frames from the file so I can work with them using other scripts to translate, get coordinates, etc.
I have more or less succeeded in doing this using the textFrame's name.
I'm currently renaming each item in the Layers window with a key-value naming structure (000-000-000|Title, 000-000-000|Description) and then splitting the name by '|' to get the product code [0] and the textFrame 'tag' [1]. Then I can run the 'tag' portion of the content through a translation script, or coordinate script as needed.
But there are dozens of pages with numerous products on each page, and multiple fields (title, description, price, quantity, product number) for each product.
I don't want to propose our designer meticulously rename thousands of elements.
I have found the Tags window to be much quicker to associate a type to each textFrame. But I haven't been able to work with the tags through script...
From what I've read, CS5 and later doesn't allow you to get a tag/label through scripting.
Is this true? Is anyone aware of any way around it?
-TLDR-
I have thousands of text (and image) elements in a InDesign file, and I would like to pull their contents out with a script and process them depending on the text field's type (product description, image, price, etc.).
Tags/Labels seem perfect, as I could just loop through all textFrame elements, and say if has tag 'description' then pass into translate(), if image getCoords().
And they are rather quick to associate with elements.
But from what I've read CS5 + doesn't allow you to work with tags through scripts in this way.
Any suggestions to accomplish this without working with the textFrame's names? (I'd like to avoid adding that much work to our graphic designer's monthly process)
If it is relevant I'm using inDesign CC 2017 V- 12.1.0.56
Thanks in advance for any input or direction you can provide. InDesign is not something I am familiar with 😕😕
