• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Move all pages of one document to another.

Advocate ,
Sep 22, 2017 Sep 22, 2017

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:

Move_Pages_01.JPG

But I want to know how to use all pages method as per below snapshot.

I want to move all pages without deleting.

Move_Pages.JPG

Thanks & Regards

Sunil Y.

TOPICS
Scripting

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 22, 2017 Sep 22, 2017

Copy link to clipboard

Copied

If you dont want to delete, then instead of move use duplicate method

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 22, 2017 Sep 22, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 22, 2017 Sep 22, 2017

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 22, 2017 Sep 22, 2017

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));

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 22, 2017 Sep 22, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 22, 2017 Sep 22, 2017

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));

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 22, 2017 Sep 22, 2017

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 22, 2017 Sep 22, 2017

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

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 22, 2017 Sep 22, 2017

Copy link to clipboard

Copied

Prabhu, he said he dont want to use duplicate method

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 25, 2017 Sep 25, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 30, 2021 Sep 30, 2021

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines