Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 93817

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

$
0
0

Hi, I try again

 

changed it into this:

 

but not error

 

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

 

app.doScript('main()', ScriptLanguage.JAVASCRIPT, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Find-change num"); 

 

function main(){

    for ( var i = 0; i < nDocs; i++ ) { 

        var curDoc = app.documents[i], 

        mPages = curDoc.masterSpreads.everyItem().pages.itemByRange(0, -1), 

        target = mPages.textFrames.everyItem().paragraphs.everyItem(); 

 

app.findGrepPreferences = changeGrepPreferences = null; 

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

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

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

        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[i].changeGrep(); 

         } 

     }

}

 

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

 

Teetan


Viewing all articles
Browse latest Browse all 93817

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>