Reply To: Script to duplicate page/spread after current

#114690

Someone might find the following script useful.

It duplicates each page in place instead of appending the duplicates to the end of the document (e.g. 1-2-3 becomes 1-1-2-2-3-3).

// Define variables
var file = app.activeDocument;
var pages = file.pages;
var numberOfPages = pages.length;

// Duplicate each page
for (i = 0; i < numberOfPages; i++) {
file.pages[i].duplicate();
}

// Intertwine pages
for (var i = 0; i < (numberOfPages – 1); i++) {
var currentPage = (numberOfPages + i);
var insertPoint = (i + i);

file.pages[currentPage].move(LocationOptions.AFTER, file.pages[insertPoint]);
}

This article was last modified on March 1, 2019

Comments (0)

Loading comments...