Copy link to clipboard
Copied
Hi I'm after a script so I can merge multiple Indesign documents into one. This is so we can quickly locate missing links quicker from a supplied folder.
Try this script: Merge files by Michael Zaichenko
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I'm not JS guy so this is a very "crude" solution:
var a=0;
var CheckIfEven = true;
var RemoveSections = true;
for (a=app.documents.length-1;a>0;a--)
{
if (!CheckIfEven || (app.documents[a].pages.length % 2 === 0 && app.documents[0].pages.length % 2 === 0))
{
// do nothing
}
else
{
app.documents[0].pages.add();
};
app.documents[a].pages.itemByRange(0,-1).duplicate(LocationOptions.AFTER, app.documents[0].pages[-1]);
app.documents[a].close(SaveOptions.NO);
};
if (RemoveSections)
{
for (a=app.activeDocument.sections.length-1;a>0;a--)
{
app.activeDocument.sections[a].remove();
};
}
You need to open your documents in the order you want to join them - script will move pages from 2 to Nth Document at the end of the 1st open document - you also need to make your "first" Document Active.
So, if you have ~30 docs - you should to do it in batches - just in case - let's say 5 docs at a time - and then save after each batch - so you'll have to repeat only last failed attempt - not everything from sratch.
So, you should open docs 1-5, switch to doc 1 and run script.
Then, after processing - save your 1st doc with a NEW NAME - "something_01-05", then open docs 6-10 - run script, save your "something_01-06" file as ""something_06-10", and so on.
You have two extra options:
var CheckIfEven = true;
var RemoveSections = true;
First - will add blank pages so each document will start on the RIGHT.
Second - will remove Sections after moving pages.
When BOTH set to False - 2nd doc starts on the left - page 2 with Section marker - and 3rd doc starts on the new spread - page 5:
When RemoveSections=true - as above but without "spaces":
And when both set to true:
(numbers represent number of pages in the joined documents - for my testing)
Also attached - but you will have to change ".TXT" to ".JSX" after downloading and saving to your scripts folder.