Google Docs allow scripting.
I’m trying to do change the color of a cell when a cell content matches a particular word. My problem is that the onEdit function is not working as specified here: https://developers.google.com/apps-script/guide_events#Simple
Whenever I try to use event.source google apps throw an error: “source of undefined”
function onEdit(event)
{
Browser.msgBox(event.source.getActiveSheet());
}
Surely this is quite basic, do I do anything wrong here?
Your code works fine, but for onEdit() functions, make sure you’re running them by editing a cell in the spreadsheet, rather than directly from the Script Editor. These built-in simple event handlers need the context of the event to be passed in in order to work properly. If you run them from the Script Editor directly, then no event object is passed in, which is why you get the error.