Quantcast
Viewing all articles
Browse latest Browse all 93817

Re: How can I find-change only in the master pages?

Hi, Jarek and Kai

 

I try the write script by my self like this but not work:

 

//---------------------------------------------------------------------------------------- -----------------

 

app.doScript('main()', ScriptLanguage.JAVASCRIPT, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Indent Paragraphs"); 

 

function main(){

var _selection = app.selection[0]; 

for ( i = 1; i < app.documents.length; i++) {    

  myDoc = app.documents[i];    

app.findGrepPreferences = changeGrepPreferences = null; 

app.findGrepPreferences.findWhat = "\\b20+\\b"; 

var found = app.selection[0].findGrep(); 

for(var f=0;f<found.length;f++) 

        app.findGrepPreferences = changeGrepPreferences = null; 

        app.findGrepPreferences.findWhat = "\\d+"; 

        var foundnum = found[f].findGrep(); 

        var newnum = parseInt(foundnum[0].contents) + 1; 

        app.changeGrepPreferences.changeTo = newnum.toString(); 

        found[f].changeGrep(); 

         } 

     }

}

 

//---------------------------------------------------------------------------------------- ------------------

 

how can fix it?


Viewing all articles
Browse latest Browse all 93817

Trending Articles