Reply To: Find and change only on odd or even pages

Home Page / Forums / General InDesign Topics (CLOSED) / Find and change only on odd or even pages / Reply To: Find and change only on odd or even pages

#81155
Peter Kahrel
Participant

Here is a general template for targeting left- or right-hand pages. This particular example underlines numbers on left-hand pages. Change LEFT_HAND to RIGHT_HAND to target rectos. Make other changes as needed in lines 4 and 9.

(function () {
  app.findGrepPreferences = null;
  app.findGrepPreferences.findWhat = 'd+';
  var found = app.activeDocument.findGrep();
  for (var i = found.length-1; i >= 0; i--) {
    if (found[i].parentTextFrames.length > 0 && found[i].parentTextFrames[0].parentPage.side === PageSideOptions.LEFT_HAND) {
      // i.e. not overset and on a recto
      // Do something, e.g.
      found[i].underline = true;
    }
  }
}());

Peter

This article was last modified on January 27, 2016

Comments (0)

Loading comments...