Q:

Opening Google spreadsheet by name; getID() method fails

I'm trying to open a spreadsheet, knowing the name, with a Google script. It's harder than it seems, but I think that I'm close. What I have is below. I'm getting an error Execution failed: TypeError: Cannot find function getID in object File. (line 37, file "Code") on the first line of onFormSubmit(e). Here's the code:
function getFileByName(filename) {
  var files = DocsList.getRootFolder().find("title:" + '"' + filename + '"');    
  for( var i in files){
    if ( files[i].getName() == filename ) 
    {
      Logger.log("found " + files[i].getName());
      return files[i];
    }
  }     
  Logger.log("did not find " + filename);
} 

function onFormSubmit(e) {

  var SPREADSHEET_ID = getFileByName('Reassessment Requesttemp').getID();//getID(names[0]);
  var app = UiApp.getActiveApplication();

  SpreadsheetApp.openById(SPREADSHEET_ID).appendRow([e.values[0], e.values[1],e.values[2], e.values[3],e.values[4], e.values[5],e.values[6], e.values[7],e.values[8], e.values[9],'', '',]);

Thanks for the help!

A:

*hangs head in shame
getID() isn't a thing. getId() is. 
Sooo... if you need to do open a spreadsheet by (unique) name: here you go!

