Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Detach all master page elements (entire document)?

$
0
0

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){}

  }

}


Viewing all articles
Browse latest Browse all 15932

Trending Articles



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