Skip to main content
samy@123
Inspiring
July 10, 2021
Answered

get list of tag and mapping names

  • July 10, 2021
  • 1 reply
  • 446 views

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

This topic has been closed for replies.
Correct answer m1b

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);
    }
}

1 reply

m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
July 11, 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);
    }
}
samy@123
samy@123Author
Inspiring
July 11, 2021

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);
}
}