Skip to main content
M.Hasanin
Inspiring
June 11, 2020
Answered

Trying to Reverse Page Orders with TextFrames

  • June 11, 2020
  • 2 replies
  • 1162 views

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  

This topic has been closed for replies.
Correct answer brian_p_dts

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

 

 

 

2 replies

Participant
August 23, 2022

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 

Legend
August 23, 2022

Hello @leroym85917040,

 

See the link below for guidance...

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

 

Regards,

Mike

 

brian_p_dts
Community Expert
brian_p_dtsCommunity ExpertCorrect answer
Community Expert
June 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);
}

 

 

 

M.Hasanin
M.HasaninAuthor
Inspiring
June 12, 2020

Thank you verymuch indeed  mr.brianp311

 

best regards

Mohammad Hasanin