Highlighted

Trying to Reverse Page Orders with TextFrames

Engaged ,
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  

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

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

 

 

 

TOPICS
Scripting

Views

218

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

Trying to Reverse Page Orders with TextFrames

Engaged ,
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  

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

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

 

 

 

TOPICS
Scripting

Views

219

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
Jun 11, 2020 0
Adobe Community Professional ,
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
Reply
Loading...
Jun 11, 2020 1
medos20 LATEST
Engaged ,
Jun 11, 2020

Copy link to clipboard

Copied

Thank you verymuch indeed  mr.brianp311

 

best regards

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
Reply
Loading...
Jun 11, 2020 0