Hi all-
I'm using a script I found here to override all master items across an entire document, but I need to add a subroutine (or modify the existing one) to then detach all those elements from the master as well.
My scripting skills are limited to very basic stuff, this is beyond me. Can anyone help, or point me in the right direction? Thanks!
Here's the current script to override the master page elements (which works perfectly, thanks to whoever originally wrote this!):
#target indesign;
var myDocument = app.activeDocument;
var TotalPages = (myDocument.pages.count());
for(var CurrentPage=0; CurrentPage < TotalPages; CurrentPage++) {
OverrideMasterItems();
}
function OverrideMasterItems() {
var allItems = myDocument.pages[CurrentPage].appliedMaster.pageItems.everyItem().getElements();
for(var i=0;i<allItems.length;i++){
try{allItems[i].override(myDocument.pages[CurrentPage])}
catch(e){}
}
}