1
votes

I registered my trigger on Edit->Current Project's Trigger and then made this:

function onEdit(e) {
  SpreadsheetApp.getActiveSheet().toast(e.value);
}

I also tried it without registering the trigger in case there's some odd collision thing. Is there something else I need to do to trigger the function?

2
Have you authorized the script? You generally need to force a permissions dialog to pop up before your triggers will run. Also, do not name installed triggers with reserved names - onEdit is reserved for a simple trigger, and will always attempt to run when a user edits cells, even if the function calls services that need authorization. It will generate errors when it encounters those lines.tehhowch
Oh yes, I bet I have to run a fake function just to see if the permission thing will come up. I'll try tomorrow. Many other times I do the event at the end for the menu and have debugged already. This was just throw away code so I forgot.Henrietta Martingale

2 Answers

0
votes

Either you need to do authorization like tehhowch's comment suggests, or your function has an error. If it has an error and it won't pop up and notify you, try to run the function manually with the debugger and be sure your script is correct.

0
votes

Here's a bunch of reserved simple trigger functions that you should not use as variable name as they're integral in Apps Script:

  • onOpen(e) runs when a user opens a spreadsheet, document, or form that he or she has permission to edit.
  • onEdit(e) runs when a user changes a value in a spreadsheet.
  • onInstall(e) runs when a user installs an add-on.
  • doGet(e) runs when a user visits a web app or a program sends an HTTP GET request to a web app.
  • doPost(e) runs when a program sends an HTTP POST request to a web app.