title: Saving a png with photoshop script not working
body: <pre><code>if (app.documents.length != 0) {
      var doc= app.activeDocument;
  
      for (i = 0; i &lt; 5; i++) {
          var layer = doc.artLayers[0]
          layer.textItem.contents = i;
  
          var pngFile    = new File("/Users/dlokshin/temp/" + i + ".png");
          pngSaveOptions = new PNGSaveOptions();
          pngSaveOptions.interlaced = false;
          doc.saveAs(pngFile, pngSaveOptions, true, Extension.LOWERCASE);
      }
  }
  </code></pre>
  
  <p>Whenever I run the script above, instead of saving the files as 1.png, 2.png, 3.png, etc it opens up the save dialogue box and prompts me to type in the file name and click save. What am I doing wrong?</p>