2 Replies Latest reply on Mar 12, 2018 9:48 AM by whiskys8043558

    Help with an incrementation and exporting script.

    whiskys8043558

      Hi, I'm trying to use the following code to increment a text layer then export the image. It successfully increments, but it's not exporting or throwing an error message. Note: Most of this code isn't mine, and I'm a relative newb.

      ----------------------------------------------------

       

       

      var layer = activeDocument.layers[0];

      if (layer.kind == 'LayerKind.TEXT') {

      for (var i=1; i < 7; i++) {

      layer.textItem.contents = i.toString();

      sfwPNG24('C:\Users\WS\Pictures\ ' + i + '.png');

      }

      }

       

       

      function sfwPNG24(saveFile){

      var pngOpts = new ExportOptionsSaveForWeb();

      pngOpts.format = SaveDocumentType.PNG;

      pngOpts.PNG8 = false;

      pngOpts.transparency = true;

      pngOpts.interlaced = false;

      pngOpts.quality = 100;

      activeDocument.exportDocument(new File(saveFile),ExportType.SAVEFORWEB,pngOpts);

      }