[win][js][cs4]find/change paragraph styles without losing local overrides


hi guys need little here.

 

i created javascript find , replace doc file paragraph styles indesign paragraph styles. works fine problem when applies paragraph styles loses local overrides. tried:

changetext(false);

but not working there kind of conditional parameter can put in changetext() function wont clear local overrides?

 

thanks.

charlesd

use findgrep() (or findtext()) instead of changetext(). returns array of found items. can loop through array , apply paragraph style without clearing overrides (the 2nd parameter should false).

 

example:

main();  function main() {     var founditem;         var doc = app.activedocument;      app.findgreppreferences = app.changegreppreferences = nothingenum.nothing;          app.findgreppreferences.findwhat = ".+";     app.findgreppreferences.appliedparagraphstyle = "body text";          var founditems = doc.findgrep();          (var = 0; < founditems.length; i++) {         founditem = founditems[i];         founditem.applyparagraphstyle(doc.paragraphstyles.item("body"), false);     }      app.findgreppreferences = app.changegreppreferences = nothingenum.nothing; } 


More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support