質問

I'm trying to find a way, in Adobe ExtendScript Toolkit CS5, to access the "tags" for currently selected text in InDesign.

I already have code that returns the selected text as a Word object or Text object to my functions, but I need to be able to detect all tags applied to the text. For instance, in the example below, I would want to detect "stockno" for the highlighted text.

enter image description here

I've looked all through the Data Browser for an instance of "stockno", but I couldn't find it. I'm not sure if the tag information is stored on a character-by-character basis or on a whole Word object. I haven't found any reference to this sort of tag in the InDesign ExtendScript documentation.

When I refer to "tags", I'm referring to the Window > Utilities > Tags sort instead of the XML Elements sort.

役に立ちましたか?

解決

I have found the location of the information I needed

Once you have a Text object textObj, pull textObj.associatedXMLElements. Iterate through through those XMLElements and check textObj.associatedXMLElements[n].markupTag.name to see the names of the "tags" that have been applied to it.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top