title: Installed on edit trigger ... which sheet was edited?
body: <p>Example:</p>
  
  <p><a href="https://spreadsheets.google.com/ccc?key=0Am8IA9FchrLbdHlkbWFMOWtZa1Y0RWpMNUV5Q3RMaVE&amp;hl=en&amp;authkey=CPXlr5UL" rel="nofollow">https://spreadsheets.google.com/ccc?key=0Am8IA9FchrLbdHlkbWFMOWtZa1Y0RWpMNUV5Q3RMaVE&amp;hl=en&amp;authkey=CPXlr5UL</a></p>
  
  <p>When you install an on-edit trigger, your function gets passed the start and end rows and columns. But not which sheet was edited.</p>
  
  <p>Naturally, my first thought was to grab SpreadsheetApp().getActiveSheet() but that doesn't work.</p>
  
  <p>Edit any cell in the example spreadsheet. The installed on-edit trigger will fill in values to Sheet1 telling you what you edited. Now switch to sheet 2 or sheet 3 and edit something. It always reports that Sheet1 was edited.</p>
  
  <p>The trigger's code:</p>
  
  <pre><code>function my_on_edit(e) {
  
    //the object passed in, e, doesn't know what sheet was edited. Really!
  
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var spreadsheetname = ss.getName();
  
    var thesheet = ss.getActiveSheet();
  
    var sheetname = thesheet.getName();
  
    //Tell us what was edited, please.
    ss.getSheetByName("Sheet1").getRange("A2:E2").setValues([[ spreadsheetname, sheetname, e.range.rowStart, e.range.columnStart, Utilities.jsonStringify(e)]]);
  
  }
  </code></pre>
  
  <p>How can I get the sheet edited? Is this my mistake or is this a bug? Or a deficiency in how they're doing the event handling?</p>