Reply To: Script to duplicate page/spread after current

#71190
Anonymous
Inactive

The only problem I find with this script is that when you duplicate multiple pages at once with itemByRange(), they all come in as one spread, i.e. if I duplicated 10 pages, they would be part of a single spread in the destination document. On the other hand if I duplicate spreads by range, they lose text threading from one spread to another, therefore defeating the whole purpose of scripting it. Any ideas on this? I’m trying to combine several threaded documents into one with these but run into aforementioned issues:

var initDoc = app.open(File (Doc1.indd));
for (b = 1; b < Docs.length; b++){
var pg = initDoc.spreads.lastItem();
var nxtDoc = app.open(File (Docs[b]), false);
nxtDoc.spreads.itemByRange(0, nxtDoc.spreads.length-1).duplicate(LocationOptions.AT_END, pg);
nxtDoc.close(SaveOptions.NO);
}
OR

var initDoc = app.open(File (Doc1.indd));
for (b = 1; b < Docs.length; b++){
var pg = initDoc.pages.lastItem();
var nxtDoc = app.open(File (Docs[b]), false);
nxtDoc.pages.itemByRange(0, nxtDoc.spreads.length-1).duplicate(LocationOptions.AT_END, pg);
nxtDoc.close(SaveOptions.NO);
}

Michael

This article was last modified on October 22, 2014

Comments (0)

Loading comments...