Reply To: Script for identifying blank pages with Master Page applied

#89896
Peter Kahrel
Participant

Not sure what uou mean by

> so that I can remove the applied master page immediately leaving them completely blank

Maybe ‘apply [None] to them’? In that case:

(function () {
  var list = [];
  var pages = app.documents[0].pages.everyItem().getElements();
  for (var i = 0; i < pages.length; i++) {
    if (pages[i].pageItems.length === 0 && pages[i].appliedMaster !== null) {
      list.push (pages[i].name);
      pages[i].appliedMaster = null
    }
  }
  alert ('Blank pages with a master applied: \r\r' + list.join('\r'));
}());

The script lists the page numbers as well so you can check.

Peter

This article was last modified on November 18, 2016

Comments (0)

Loading comments...