Copy link to clipboard
Copied
Hi all,
Using javascript I tried to move all pages from a document to another, I found method name move
//~ var sourcePages = source_doc.pages.itemByRange(myDocFirstPage, myDocLastPage);
var sourcePages = source_doc.pages.everyItem();
sourcePages.move(LocationOptions.AFTER, destination_doc.pages.item(-1));
Error:
But I want to know how to use all pages method as per below snapshot.
I want to move all pages without deleting.
Thanks & Regards
Sunil Y.
Copy link to clipboard
Copied
If you dont want to delete, then instead of move use duplicate method
Copy link to clipboard
Copied
But when I use duplicate method for a large file, it takes longer time to execute.
I want to use "Move pages" method.
Copy link to clipboard
Copied
Okay.. I think you missed with pages.everyItem().getElements() instead of pages.everyItem()...
also some useful threads..
duplicate pages and move to another file
[JS CS5] page.duplicate mixed page orientations/sizes does not cause shuffle
Re: Moving pages to another document using applescript or Javascript
Copy link to clipboard
Copied
this one works.. but need to give the page range for the source document.. because we cant move all the pages..it need atleast one
var sourcePages = app.documents[0];
sourcePages.pages.itemByRange(1,1).move(LocationOptions.AFTER, app.documents[1].pages.item(-1));
Copy link to clipboard
Copied
Great efforts sir, I appreciate it, but I do not want to give page range too and don't want to write long code for assigning page ranges, instead simply want to move all pages without range and without deleting pages.
Copy link to clipboard
Copied
Then you have to stick with duplicate method.. this will work
var sourcePages = app.documents[0];
sourcePages.pages.everyItem().duplicate(LocationOptions.AFTER, app.documents[1].pages.item(-1));
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi,
hope its may helps to you!!!
var source_doc = app.documents.item('source_file.indd');
var destination_doc = app.documents.item('destination_file.indd')
var sourceSpreads = app.activeDocument.spreads.everyItem();
sourceSpreads.duplicate(LocationOptions.AFTER, source_doc.spreads.item(-1));
Thanks,
Prabu
Copy link to clipboard
Copied
Prabhu, he said he dont want to use duplicate method
Copy link to clipboard
Copied
Prabu, I want to move all pages using "All Pages" instead of page range and uncheck "Delete Pages After Moving" using script, because duplicate method first saves all data in a variable then paste, that results into time delay if files which are longer and contains heavy images...
Thanks,
Sunil Y.
Copy link to clipboard
Copied
hey sunil
i have facing same script problem,i want move all the spread from one indesign document to another (1 spread (2 facing page) ind document ,can you please help .It would great help .
sukriti