title: exportDocument() 'destination folder does not exist' error
body: <p>I'm trying to make a script in photoshop that will modify some layers and than export them as a PNG image. I've copied the following code from another place:</p>
  
  <pre><code>function SavePNG(saveFile){
      var pngOpts = new ExportOptionsSaveForWeb; 
      pngOpts.format = SaveDocumentType.PNG
      pngOpts.PNG8 = false; 
      pngOpts.transparency = true; 
      pngOpts.interlaced = true; 
      pngOpts.quality = 100;
      activeDocument.exportDocument(saveFile,ExportType.SAVEFORWEB,pngOpts);
  }
  </code></pre>
  
  <p>The function export the active document of photoshop to the file specified by the saveFile parameter.</p>
  
  <p>It's working fine with simple paths like "C:\images\result.png" but when trying with different paths like "~/Desktop/" or paths with some special characters the file isn't exported, and a "destination folder does not exist" error message appears.</p>
  
  <p>Any idea how can I solve it?</p>