Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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);
}
Copy link to clipboard
Copied
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);
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Works fine for me...
Copy link to clipboard
Copied
Maybe the pages in your file are already rotated (even if they don't look like it). To accommodate for that try this code:
for (var i=0; i<this.numPages; i++) {
var pageRotation = this.getPageRotation(i);
if (i%2==0) pageRotation+=90;
else pageRotation-=90;
if (pageRotation==360) pageRotation = 0;
else if (pageRotation==-90) pageRotation = 270;
this.setPageRotations(i, i, pageRotation);
}
Copy link to clipboard
Copied
Brilliant! That was exactly it; I was trying the script on a file to which I had already applied page rotations. When testing it with a fresh scan it works exactly as I need. Thanks a million!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more