Skip to main content
Participating Frequently
July 31, 2025
Answered

Create Custom Tool to rotate odd and even pages differently?

  • July 31, 2025
  • 1 reply
  • 412 views

I very frequently need to do this routine: choose Organize Pages, select all odd pages, rotate 90º CW, select all even pages, rotate CCW. I'd like to create a Custom Tool to do this but don't see how to select odd/even pages. Any advice?

Correct answer try67

You can do it by adding this JavaScript code to your Custom Tool:

 

for (var i=0; i<this.numPages; i++) {
	if (i%2==0) this.setPageRotations(i, i, 90);
	else this.setPageRotations(i, i, 270);
}

 

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 31, 2025

You can do it by adding this JavaScript code to your Custom Tool:

 

for (var i=0; i<this.numPages; i++) {
	if (i%2==0) this.setPageRotations(i, i, 90);
	else this.setPageRotations(i, i, 270);
}

 

phidlerAuthor
Participating Frequently
August 1, 2025

Thank you. I'm sure I've done something incorrectly; when I click either "Start" or "Execute JavaScript" from the tool I created in Action Wizard with your script I get this dialog box, but when I click OK it reports "Completed" with no change in page orientation.

 

 

try67
Community Expert
Community Expert
August 1, 2025

Works fine for me...