Skip to main content
Participant
Oct 14, 2011 2:46 PM UTC
Answered

script to insert new master on every other page

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!!

jh9999Correct answer
Participant
Oct 14, 2011 3:15 PM UTC

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

6 replies

toddt43397558
Participant
Jan 20, 2022 9:04 PM UTC

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

Translate
Participant
Sep 29, 2022 9:54 AM UTC

This was great.  Thanks so much.  Worked perfectly.

Translate
jh9999AuthorCorrect answer
Participant
Oct 14, 2011 3:15 PM UTC

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

Translate
Participant
Aug 1, 2014 9:53 PM UTC

This was SO helpful to me! Thank you!

Translate