Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

determine XMLTags name of current selection

Community Beginner ,
Feb 16, 2010 Feb 16, 2010

Dear scripters,

I'd like to find a way to alert the XMLTags name of the currently selected text or of the text where my cursor currently stands in.

Something like this works:

alert(app.activeDocument.xmlTags.item(0).name);

The problem is, that the above sample is static and only shows the name of item(0).

How can I fix this?

By the way, where can I look up the XML tags syntax? Is there any literature or a syntax overview?

Thanks for your help,

TYPO

TOPICS
Scripting
407
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Feb 16, 2010 Feb 16, 2010

Hi Typo,

try below code on CS4

alert(app.selection[0].associatedXMLElements[0].markupTag.name)

You can use Jongware Indesign Object Reference. Check below link
Shonky

Translate
Engaged ,
Feb 16, 2010 Feb 16, 2010

Hi Typo,

try below code on CS4

alert(app.selection[0].associatedXMLElements[0].markupTag.name)

You can use Jongware Indesign Object Reference. Check below link
Shonky

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 16, 2010 Feb 16, 2010
LATEST

COOLIO!

It works perfect, thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines