3 Replies Latest reply on Oct 15, 2012 1:34 PM by drumboy1956

    How to sort pdf documents by modified date using Javascript action

    drumboy1956

      Hello,

      I want to use a Javascript action to sort multiple pdf documents in a folder before I run a Javascript action that prints the last page of multiple pdf documents.  I received help from this forum on the last page print script and it works perfectly.  The downside is it prints in default NAME order and I need them to print in accending DATE MODIFIED order.  I'm not sure if the sort function could be incorporated into the print script or if it would be a seperate code/action.

      This is the script to print the last page of several pdf documents:

       

      this.print

      ({bUI: false,

      nStart:this.numPages-1,

      bSilent: true,

      bShrinkToFit: true});

       

      I would appreciate help from anyone that is willing to share the code to "sort by DATE MODIFIED".

       

      Adobe Acrobat 10 Pro

      Windows 7

       

      Thank you in advance,

      David C.

        • 1. Re: How to sort pdf documents by modified date using Javascript action
          Test Screen Name Most Valuable Participant

          It isn't as simple as we would like. The code you mention is called for each entry in an action separately. The order of files in an action is not under the control of JavaScript, nor anything else so far as I know.

           

          So...could we write a self-contained piece of JavaScript? No, not really as JavaScript can't scan a directory in any way.

          • 2. Re: How to sort pdf documents by modified date using Javascript action
            try67 MVP & Adobe Community Professional

            The way to do that is to separate the two processes: First you use an

            action to collect the file paths (and maybe the mod date), and then a

            folder-level script to sort the files, open them one after another and

            process them the way you want to.

            • 3. Re: How to sort pdf documents by modified date using Javascript action
              drumboy1956 Level 1

              I'm not a code writer.  I'm trying to streamline some operations here at work.  The original code assistance was to print the last page of several pdf documents (sometimes as many as 100 to 150 at a time) without having to open each file, scroll to the bottom, Ctrl-P, current page, Print.  Can't express how beneficial it was to get that to work.  I realize I'm looking a gift horse in the mouth, but when it prints out, it would be great to have them print in DATE MODIFIED order since they are kept in processed order rather than alpha order.

               

              If the two processes are too labor intensive I fully understand and appreciate all the assistance thus far.  I was hoping it would be as simple as the first script coding to do the actual printing.

               

              Thanks,

               

              David C.