Dear Frnds,
I want to search string(strings which are bold) from my document textframe and apply xmltags for that... I worked with the below codes... But it's not working well... (b-bold tag with a color tag)
docObj=app.activeDocument;
xmlObj = docObj.xmlTags;
app.findTextPreferences = app.changeTextPreferences = null;
//app.findTextPreferences.findWhat = '(.+)';
app.findTextPreferences.fontStyle = "Bold";
app.changeTextPreferences.changeTo = docObj.xmlImportMaps.xmlObj.tags.item(name:b);
docObj.mapXMLTagsToStyles();
Thanks and Regards,
Vel.
Finally I got the correct codes after no. of attempts i tried...
Below is the code:
docObj=app.activeDocument;
xmlObj = docObj.xmlTags;
pageObj=docObj.pages.item(0);
myTextFrame=pageObj.textFrames.item(0);
myText=myTextFrame.parentStory.paragraphs.item(0);
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.fontStyle = "Bold";
app.changeTextPreferences.markupTag=xmlObj[0].name;
alert(app.changeTextPreferences.markupTag);
app.activeDocument.changeText();
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.fontStyle = "Bold Italic";
app.changeTextPreferences.markupTag=xmlObj[1].name;
alert(app.changeTextPreferences.markupTag);
app.activeDocument.changeText();
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences.fontStyle = "Italic";
app.changeTextPreferences.markupTag=xmlObj[2].name;
alert(app.changeTextPreferences.markupTag);
app.activeDocument.changeText();
app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.capitalization = Capitalization.SMALL_CAPS;
app.changeGrepPreferences.markupTag=xmlObj[4].name;
alert(app.changeGrepPreferences.markupTag);
app.activeDocument.changeGrep();
Thanks,
Vel...
North America
Europe, Middle East and Africa
Asia Pacific