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

get list of tag and mapping names

Explorer ,
Jul 10, 2021 Jul 10, 2021

Copy link to clipboard

Copied

hI all 

i am trying to create one script to get all list of tags and their mapping style names

any suggestion 

 

 

Thanks in advance

Anupam

TOPICS
Scripting

Views

215

Translate

Translate

Report

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

Community Expert , Jul 10, 2021 Jul 10, 2021

Hi Anupam, is this sort of what you mean?

var xmlMaps = app.activeDocument.xmlImportMaps;

for (var i = 0; i < xmlMaps.length; i++) {
    var m = xmlMaps.item(i);
    if (m.isValid) {
        $.writeln(m.markupTag.name +': ' + m.mappedStyle.name);
    }
}

Votes

Translate

Translate
Community Expert ,
Jul 10, 2021 Jul 10, 2021

Copy link to clipboard

Copied

Hi Anupam, is this sort of what you mean?

var xmlMaps = app.activeDocument.xmlImportMaps;

for (var i = 0; i < xmlMaps.length; i++) {
    var m = xmlMaps.item(i);
    if (m.isValid) {
        $.writeln(m.markupTag.name +': ' + m.mappedStyle.name);
    }
}

Votes

Translate

Translate

Report

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
Explorer ,
Jul 11, 2021 Jul 11, 2021

Copy link to clipboard

Copied

LATEST

Hi @m1b 

script is ok for desktop version Please use insted of  app.activeDocument use app.documents[0]

for server version I am working on indesign server 2019...

var xmlMaps = app.documents[0].xmlImportMaps;

for (var i = 0; i < xmlMaps.length; i++) {
var m = xmlMaps.item(i);
if (m.isValid) {
$.writeln(m.markupTag.name +': ' + m.mappedStyle.name);
}
}

Votes

Translate

Translate

Report

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