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

Trying to Reverse Page Orders with TextFrames

Enthusiast ,
Jun 11, 2020 Jun 11, 2020

Copy link to clipboard

Copied

Dear Professionals.

I'm Trying to Make InDesign Reverse the Page orders so simply page 10 with its content will become page 1 and page 1 will become page 10,, etc to all the document so i tried hard with this code..

but i dont know what the wrong ?

 

//Reverse Page Order
var myDoc = app.activeDocument;
var myFrame = myDoc.textFrames.everyItem();
for (var i = myDoc.pages.length - 1; i >= 0 ; i--) {
myFrame[i].move (myFrame.parentPage.documentOffset);
}

 

 it not working, can you help please 

 

Best regards

Mohammad  

Best
M.Hasanain
TOPICS
Scripting

Views

481

Likes

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

correct answers 1 Correct answer

Community Expert , Jun 11, 2020 Jun 11, 2020

Just move the pages

 

 

var pages = app.activeDocument.pages;
var numPages = pages.length -1;
for (var i = numPages; i >= 0; i--) {
   pages[i].move(LocationOptions.AT_END);
}

 

 

 

Likes

Translate

Translate
Community Expert ,
Jun 11, 2020 Jun 11, 2020

Copy link to clipboard

Copied

Just move the pages

 

 

var pages = app.activeDocument.pages;
var numPages = pages.length -1;
for (var i = numPages; i >= 0; i--) {
   pages[i].move(LocationOptions.AT_END);
}

 

 

 

Likes

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
Enthusiast ,
Jun 11, 2020 Jun 11, 2020

Copy link to clipboard

Copied

Thank you verymuch indeed  mr.brianp311

 

best regards

Best
M.Hasanain

Likes

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 ,
Aug 23, 2022 Aug 23, 2022

Copy link to clipboard

Copied

Hi,

 

I also need this for my publication. However, I haven't had any experience with adding this code to my indesign file... Can someone direct me or explain how to do this?

 

Thanks,

Leroy 

Likes

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
Advisor ,
Aug 23, 2022 Aug 23, 2022

Copy link to clipboard

Copied

LATEST

Hello @leroym85917040,

 

See the link below for guidance...

https://creativepro.com/how-to-install-scripts-in-indesign/

 

Regards,

Mike

 

Likes

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