title: How to check multiple PDF files for annotations/comments?
body: <p>Problem: I routinely receive PDF reports and annotate (highlight etc.) some of them. I had the bad habit of saving the annotated PDFs together with the non-annotated PDFs. I now have hundreds of PDF files in the <em>same folder</em>, some annotated and some not. Is there a way to check every PDF file for annotations and copy only the annotated ones to a new folder?</p>
  
  <p>Thanks a lot!</p>
  
  <p>I'm on Win 7 64bit, I have Adobe Acrobat XI installed and I'm able to do some beginner coding in Python and Javascript</p>
  
  <hr>
  
  <p>Please ignore the following suggestion, since the answers already solved the problem.</p>
  
  <p><del>EDIT: Following Mr. Wyss' suggestion, I created the following code for Acrobat's Javascript console to be run only <em>once</em> at the beginning:</p>
  
  <pre><code>counter = 1;
  
  // Open a new report
  var rep = new Report();
  rep.size = 1.2;
  rep.color = color.blue;
  rep.writeText("Files WITH Annotations");
  </code></pre>
  
  <p><del>Then this code should be applied to all PDFs:</del></p>
  
  <pre><code>this.syncAnnotScan();
  annots = this.getAnnots();
  path = this.path;
  if (annots) {
      rep.color = color.black;
      rep.writeText(" ");
      rep.writeText(counter.toString()+"- "+path);
      rep.writeText(" ");
      if (counter% 20 == 0) {
          rep.breakPage();
      }
      counter++;
  }
  </code></pre>
  
  <p><del>And, at last, one code to be run only <em>once</em> at the end:</del></p>
  
  <pre><code>//Now open the report
  var docRep = rep.open("files_with_annots.pdf");
  </code></pre>
  
  <p><del>There are two problems with this solution:</del></p>
  
  <p><del> 1. The "Action Wizard" seems to <em>always apply</em> the same code afresh to each PDF (that means that the "counter" variable, for instance, is meaningless; it will always be = 1. But more importantly, var "rep" will be unassigned when the middle code is run on different PDFs).
   2. How can I make the codes that should be run only <em>once</em> run only at the beginning or at the end, instead of running everytime for every single PDF (like it does by default)?</del></p>
  
  <p>Thank you very much again for your help!</del></p>