Have an account? Sign in
"*" indicates required fields
You agree that CreativePro Network may send you emails, including the newsletter selections above. You can unsubscribe at any time.
By signing in, you agree to our Terms of Use and acknowledge our Privacy Notice.
New user? Create an account
By signing in, you agree to our Terms of Use and acknowledge our Privacy Notice.
I ‘m not able to test if this actually works right now, but if you only need to duplicate the currently active page (i.e. not necessarily what you have selected), something like this might work:
var activeDocument = app.activeDocument
var activePage = app.activeWindow.activePage
activePage.duplicate()
activeDocument.pages[activeDocument.pages.length – 1].move(LocationOptions.AFTER, activePage)
There’s an en dash on line 12 that should have been a regular dash. See the updated script here:
https://gist.github.com/lassebrenden/ec2441937899b2458b0c4ffe6602a7de
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 site uses cookies, but not the kind you eat. We use cookies to remember log in details, provide secure log in, improve site functionality, and deliver personalized content. By continuing to browse the site, you accept cookies.