How can find-change grep only on Masters
Hi everyone,
I want to find-change (multi line of options) only on master
idea inspire by this line, but I am not going to find-change digit
How can I find-change only in the master pages?
thanks
Teetan
Hi everyone,
I want to find-change (multi line of options) only on master
idea inspire by this line, but I am not going to find-change digit
How can I find-change only in the master pages?
thanks
Teetan
Repeating a script multiple times is surely not a good solution. I would do it in the following way.
Try to understand what is going on here and see the differences between these lines and the last script!
if ( app.documents.length > 0 ) {
if ( app.scriptPreferences.version >= 6 ) {
app.doScript( main, ScriptLanguage.JAVASCRIPT , [], UndoModes.ENTIRE_SCRIPT, "Search in masterpages" );
}
else {
main();
}
} else {
alert ( "No documents open!" );
}
function main() {
// Your settings
// ---
var searchList = [
[ "USA" , "Obama" ],
[ "rocket" , "sky" ],
[ "New York" , "Los Angeles" ]
];
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findChangeGrepOptions.includeMasterPages = true;
var target = app.documents.everyItem().masterSpreads.everyItem().textFrames.everyItem();
for ( var j = 0; j < searchList.length; j++ ) {
var curSearch = searchList
; app.findGrepPreferences.findWhat = curSearch[0];
app.changeGrepPreferences.changeTo= curSearch[1];
target.changeGrep();
}
app.findGrepPreferences = app.changeGrepPreferences = null;
} // main
– Kai
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.