Skip to main content
Participant
October 8, 2024
Question

How to Quickly Insert Pages from One InDesign Document into Another

  • October 8, 2024
  • 4 replies
  • 1480 views
Hello

I have two InDesign documents. A first (A) of 300 different pages and a second (B) of 1 page.

I want to insert the second document (B) after each of the 300 pages, for a total of 600 pages. That is: A1-B-A2-B-A3-B-A4-B…. Up to….A299-B-A300-B What would be the quickest method?

THANKS


<Title renamed by MOD>

4 replies

Participant
January 4, 2025

Hey Steve, this is WAY after the fact, but maybe this will help someone else. You can select pages from one document and then in the page hamburger, select move pages.  Select the open document that you want to move the pages to and follow the prompt. 

Robert at ID-Tasker
Legend
January 4, 2025

@Deborah29490204ubo0

 

I'm sorry, but have you read opening post in full?  

 

Steve wants to mix pages - after each page of the Document A - one and only page from Document B should be inserted.

 

Doing this manually - 300x times - rather isn't a solution... 

 

Community Expert
October 9, 2024

Try it out on a duplicate set of files - I'm not the best scripter

 

Found a script here that looks like what you want

https://stackoverflow.com/questions/57545582/indesign-script-to-add-a-page-to-every-given-page

 

Haven't tested it properly but I suspect this might work better with a tweak 

var mainDoc = app.activeDocument; // Assuming this is Document A
var insertDoc = app.documents.itemByName("B.indd"); // Open Document B separately

var addPageLocation = 0;  
var docLength = mainDoc.pages.length;  // Start with the original length of Document A

for (var i = 0; i < docLength; i++) {

    // Duplicate the page from Document B to Document A after each page
    insertDoc.pages[0].duplicate(LocationOptions.AFTER, mainDoc.pages[addPageLocation]);

    // Update the page location to skip over the newly added page from Document B
    addPageLocation += 2;
}

 

 

 

Robert at ID-Tasker
Legend
October 9, 2024

@Eugene Tyson

 

It should work - I'm on my phone so can't test your code.

 

But just in case, in situations like this - it's better to iterate backward. 

 

Dave Creamer of IDEAS
Community Expert
Community Expert
October 9, 2024

Create PDFs of each file. Check out PDFsam Basic, a free open-source program. It can do an alternative mix of the pages. 

https://pdfsam.org/

 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Willi Adelberger
Community Expert
Community Expert
October 9, 2024

Put all INDD files into a book INDB and export from there all you need. 

Robert at ID-Tasker
Legend
October 9, 2024
quote

Put all INDD files into a book INDB and export from there all you need. 


By @Willi Adelberger

 

How this will mix pages from both files? 

 

Steve Werner
Community Expert
Community Expert
October 8, 2024

Write a script, or get someone to write a script. There is no built-in feature in InDesign to do it.