title: Open Google Apps Spreadsheet by name
body: <p>With a script I create a new Google Spreadsheet every day.  I'm certain there is only one spreadsheet on the drive with this name, as I trash everything with the same name before creating a new one.</p>
  
  <p>But how can I open the spreadsheet with google apps script? I have no ID for the file. I have a small script so I can find the file:</p>
  
  <pre><code>function myFunction() {
   // Log the name of every file in the user's Drive.
  var files = DriveApp.getFilesByName('datafile');
  while (files.hasNext()) {
  var file = files.next();
  Logger.log(file.getName());
  }
  }
  </code></pre>
  
  <p>Is it possible to open this spreadsheet at all with a script? I want to download it everyday on a server as csv file..</p>