Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

script to insert new master on every other page

Community Beginner ,
Oct 14, 2011 Oct 14, 2011

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

TOPICS
Scripting
9.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Oct 14, 2011 Oct 14, 2011

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

Translate
Community Beginner ,
Oct 14, 2011 Oct 14, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2014 Aug 01, 2014

This was SO helpful to me! Thank you!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 20, 2022 Jan 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});}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 29, 2022 Sep 29, 2022

This was great.  Thanks so much.  Worked perfectly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 12, 2024 Feb 12, 2024

amazing! thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 08, 2025 Aug 08, 2025
LATEST

Amazing! Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines