Skip to main content
Participant
October 14, 2011
Answered

script to insert new master on every other page

  • October 14, 2011
  • 2 replies
  • 9247 views

I've got an indesign document with 131 pages (front side of postcards). I need to add the back side of the postcard (Master) to every other page. I don't want to manually do this due to the time and that I will need to do this again and again. Does anyone have a script that will allow for an insertion of even blank pages on the even number pages and then I can apply the master page to all blank pages?  Anything will help. Thank you!!

Correct answer jh9999

Just found that the script on this forum http://forums.adobe.com/message/3223771#3223771#3223771 does it perfectly.

2 replies

toddt43397558
Participant
January 20, 2022

I am not sure where I originally got this script but I have been using it for years.  It works perfectly for inserting the Master (Parent) Page of your choice after every other page in a document - for adding a backside to a multi-up mail mergeed letter or postcard, for example.  For those who are new to scripts (as I was) just copy the text below and past into Notepad (PC) or Textedit (Mac) then choose Save As and make a text document on your desktop with the extension .js  It should show up with the S JavaScript icon.  Then open InDesign, open scripts, scroll down to the user folder, right click on it and choose "Reveal in Explorer" or the Mac equaivalent, then drag the script into that folder.  It will show up in your user scriipt menu without having to restart InDesign.  Hope it works for you!

 

var doc = app.documents[0];
var masterNames = doc.masterSpreads.everyItem().name;
var d = app.dialogs.add({name:"pick a master spread"});
d.dialogColumns.add().staticTexts.add({staticLabel:"Master Pages:"});
var dd = d.dialogColumns.add().dropdowns.add({stringList:masterNames});
if(d.show()){
var index = dd.selectedIndex;
d.destroy();
} else {
d.destroy();exit();
}
var master = doc.masterSpreads.item(index);
for(var i=doc.pages.length-1;i>=0;i--){
doc.pages.add(LocationOptions.AFTER,doc.pages[i],{appliedMaster:master});}

Participant
September 29, 2022

This was great.  Thanks so much.  Worked perfectly.

jh9999AuthorCorrect answer
Participant
October 14, 2011

Just found that the script on this forum http://forums.adobe.com/message/3223771#3223771#3223771 does it perfectly.

Participant
August 1, 2014

This was SO helpful to me! Thank you!