[JS, ID5] Change fontStyle
hello,
i have following script changing character overrides (bold) character styles:
app.findtextpreferences = null; app.changetextpreferences = null; app.findtextpreferences.fontstyle = "bold"; app.changetextpreferences.appliedcharacterstyle = "bold"; app.documents.item(0).changetext();
the problem paragraph styles containing font style "bold" preset, get's character style "bold" assigned.
the script has skip predefined -bold made- paragraph styles!?
regards, sjoerd
hi sjord,
please try below js code, have test code in cs5.5 working fine.
var mydoc = app.activedocument; app.findtextpreferences = app.changetextpreferences = null; app.findtextpreferences.fontstyle = "bold"; var mysearch = mydoc.findtext(); for(var i=mysearch.length-1; i>=0; i--){ var mystyle = mysearch[i].appliedparagraphstyle; // note: below font style not in bold script apply bold character style. if heading has applied in bold condensed or etc. script not work. please take care. if(mystyle.fontstyle != "bold"){ mysearch[i].appliedcharacterstyle = mydoc.characterstyles.item("bold"); } }
thx,
csm_phil
More discussions in InDesign Scripting
adobe
Comments
Post a Comment