1 Reply Latest reply on Jul 3, 2014 10:13 AM by try67

    How to skip non-PDF files in Action on folder?

    cmartin616

      Hello,

       

      I have an Action in Acrobat Pro XI that takes a default folder and (using JS) batch converts the PDFs to text.  However, it also tries to convert *.txt files.  I don't care that it imports the *.txt to *.pdf as temp file but it then stops the batch processing by asking if I want to save the changes to the temporary PDF.  How can I bypass this?  Here is the JavaScript it executes:


          /* Convert PDF to Text File (*.txt) */

       

          var inPath = "../";

          var outPath = "/c/users/***/desktop/test/output/";

          var myFile = inPath + this.documentFileName

          var myFileExt = myFile.replace(/^.*\./,'');

       

          if (myFileExt == 'tmp'){

              console.println(this.path);

          } else {

              console.println('Found a PDF!');

              console.println(this.path);

              this.saveAs(outPath + this.documentFileName + ".txt", "com.adobe.acrobat.plain-text");

          }

       

      Options I'm fine with:

      • Skipping all non-PDF files from the Actions Wizard
        • Can't find a method to do this.
      • Disabling the Save As prompt for the temporary created PDFs (*.txt files)
        • The line returned by console.println(this.path) if myFileExt == 'tmp' is this":
          • /C/Users/**/AppData/Local/Temp/A9R6966.tmp
        • It still creates a temporary PDF.
        • I tried this.closeDoc('true') but it closes Acrobat entirely.

       

      I hope that is concise enough!  Thanks for looking.

        • 1. Re: How to skip non-PDF files in Action on folder?
          try67 MVP & Adobe Community Professional

          Skipping all non-PDF files from the Actions Wizard

          This used to be possible, but unfortunately it's not possible any longer in Acrobat XI.

           

          What you can try to do is just add a Save command to your Action and hope that it saves the temp files silently (maybe you can save them in some temp folder), and then closes them and continues...