title: How do I open an array of PDF files in Illustrator without user confirmation of prompts using javascript/extendscript?
body: <p>I want to open an array of files in Illustrator without prompts and apply the preference of the page number to open using Javascript. </p>
  
  <p>I've tried setting the PDF open options but that doesn't seem to suppress the prompt. It also doesn't seem to apply the options.</p>
  
  <pre><code>var pdfOptions = app.preferences.PDFFileOptions;
  pdfOptions.pDFCropToBox = PDFBoxType.PDFBOUNDINGBOX;
  pdfOptions.pageToOpen = 1;
      if (file != null) {
      var docRef = open(file, DocumentColorSpace.CMYK);
  }
  </code></pre>
  
  <p>When I set "pageToOpen" to 3 it doesn't even pre-select that in the prompt that pops up asking for a choice of which page to open. However I don't want that to pop up at all. I need to open the first page of all the files, get some information and close the files without human interaction. </p>
  
  <pre><code>var pdfOptions = app.preferences.PDFFileOptions;
  pdfOptions.pDFCropToBox = PDFBoxType.PDFBOUNDINGBOX;
  pdfOptions.pageToOpen = 1;
  // Open a file using these preferences
  if (file != null) {
      var docRef = open(file, DocumentColorSpace.CMYK, pdfOptions);
  }
  </code></pre>
  
  <p>The code above causes an error: "unknown open options found". These are examples from the illustrator programming guide.</p>