title: Import data from google spreadsheet to use with ExtendScript Toolkit
body: <p>I'm using adobe's ExtendScript Toolkit to automate some photoshop image creations. I'd like to read a google spreadsheet published (publicly) as a csv, and use data it contains to edit a psd file (where some text layer named "num" is replaced by the content of a column in the spreadsheet). Here's the spreadsheet: <a href="https://docs.google.com/spreadsheets/d/16v0CAFL7iBIRGYbQfzmRJNUaI3xytXmkkmloa41BJ5o/pub?gid=0&amp;single=true&amp;output=csv" rel="nofollow">https://docs.google.com/spreadsheets/d/16v0CAFL7iBIRGYbQfzmRJNUaI3xytXmkkmloa41BJ5o/pub?gid=0&amp;single=true&amp;output=csv</a></p>
  
  <p>And here's my code:</p>
  
  <pre><code>#target photoshop
  
  **import google spreadsheet here as a csv, and parse**
  
  for (i = 1; i &lt; num_of_rows_in_csv_file; i++) {
  
      var fileRef = new File('/file.psd')
      var doc = app.open(fileRef)
      var layer = doc.layers.getByName('num');
  
      if (layer.kind == LayerKind.TEXT) layer.textItem.contents = content_of_column_A_at_row_i; //replace text by content of cell
  
      var opts, file;
      opts = new ExportOptionsSaveForWeb();
      opts.format = SaveDocumentType.PNG;
      opts.PNG8 = false;
      opts.quality = 100;
  
      pngFile = new File("/file_" + i + ".png");
  app.activeDocument.exportDocument(pngFile, ExportType.SAVEFORWEB, opts);
  
  }
  </code></pre>
  
  <p>How to accomplish this in javascript within ExtendScript?</p>