I have one xml file and I am reading data from it using indesign java scripting.
At one point I got stuck whenever I get text in xml enclosed within '<b>'INDIA'</b>'
then should get converted to bold INDIA font for after executing java script.
Is there any way in indesign java script to convert that specific text into bold or other font style.
I don't have coded anything but below is the code which I found on Web but also not working
var doc = app.activeDocument;
var frame = doc.pages[0].textFrames.add({
geometricBounds: [700, 50, 500, 200]
});
var bold = doc.characterStyles.add({name:"Bold", fontStyle:"Bold"});
var none = doc.characterStyles.itemByName("[None]");
frame.insertionPoints.lastItem().applyCharacterStyle(none);
frame.insertionPoints.lastItem().contents = "I really like";
frame.insertionPoints.lastItem().applyCharacterStyle(bold);
frame.insertionPoints.lastItem().contents = " walking to the park";
frame.insertionPoints.lastItem().applyCharacterStyle(none);
frame.insertionPoints.lastItem().contents = " and eating icecream";