title: Acrobat's "This file is already open" message
body: <p>This is a really strange one. Our company has has an InDesign script that, near the end, calls Acrobat (by way of Applescript) to open a PDF file, replace a page in it, then save the file and close it. We've been using this script for over a year and a half now with no issues on 8 of the 9 computers we have. That last one, however, is giving me an odd message when it tries to open and save the file.</p>
  
  <p>To be clear, all 9 computers are Macs, all running OS X 10.9.5 Mavericks. The script is on a central server, so they're all using the same file:</p>
  
  <pre><code>var unlockCover2014 = app.trustedFunction(function (fName, fPrefix)
  {
      app.beginPriv();
      var folderPrefix = fName.match(/^.*?(?=JOBS)/);
      console.println("fName is " + fName);
      console.println("folderPrefix is " + folderPrefix);
      var myDoc = app.openDoc(folderPrefix + "Product Templates/ProofCoverNew/proof_cover_2014.pdf");
      myDoc.replacePages(0, fName, 0, 0);
      myDoc.saveAs(fName);
      myDoc.closeDoc(true);
      app.endPriv();
  });
  </code></pre>
  
  <p>This file is stored in the correct folder to be a Folder-level script. 8 of the computers work through this without any trouble whatsoever. The 9th, however, puts this into Acrobat's Javascript console:</p>
  
  <pre><code>fName is /ArtDept/ArtDept/JOBS/425000-425999/425000 Folder/425000_cover.pdf
  folderPrefix is /ArtDept/ArtDept/
  
  RaiseError: This file is already open.
  Doc.saveAs:9:
   ===&gt; This file is already open.
  </code></pre>
  
  <p>I do not understand why this computer, alone, thinks that the PDF files are open already. The problem that arises from this is that, when the main InDesign script is done running, two documents are still open in Acrobat, and the one it's supposed to save does <em>not</em> get saved.</p>
  
  <p>Any ideas about what's going on here?</p>