Script to reorder pages in alphabetical order
Hi, I am currently trying to redorder pages based on names found within each page so I can alphabetize my document. I wrote a script that can find the name I am looking for and successfully store the name and that page number in an array of objects. I can see my search and sort function has been successful when I console.println my sorted array. however, using the this.movePage function to move the actual pages based off of my sorted (alphabetized) array has proven tricky since the page numbers are dynamic and moving one reorders the current document. Do you have a better suggestion on how to move the pages successfully?
TLDR: I have pages sorted in an array that I want the document order to resemble. How do I successfully use this.movePage to accomplish this? (Or is there another way?) Thanks in advance.
