0

I am trying to find an Indesign javascript that can set the font and style based on the import XML parent's attribute,

<product>
    <language value="EN"><feature_1>1000w</feature><feature_2>10 max</feature_2></language>
    <language value="TCN"><feature_1>500w</feature><feature_2>2 max</feature_2></language>
</product>
<product>
    <language value="EN"><feature_1>2000w</feature></language>
    <language value="TCN"><feature_1>2500w</feature><feature_2>2 max</feature_2><color>red</color></language>
</product>

each feature tag will be in its own tag frame.

all the sub-set under language value="EN" will have like Arial font,

and all the sub-set under language value="TCN" will have MingLiU font

can scripting do any of this?

Pat
  • 163
  • 4
  • 12

1 Answers1

0

you can map styles to specific elements. Have a look here http://jongware.mit.edu/idcs4js/pc_XMLImportMap.html

in use it would be something like this:

myDoc.xmlImportMaps.add(myDoc.xmlTags.item("someElement"),myDoc.paragraphStyles.item("someparagraphStyle")) ;
fabianmoronzirfas
  • 4,091
  • 4
  • 24
  • 41