How can one tell the action triggered the onEdit function in Google Apps Scripting? The actions I have found to trigger it include:
- edit a cell
- delete a cell or range
- cut or copy a cell or range
- Copy a sheet
I would like something similar to the onChange's changeType attribute that tells me what the user did.
I need to react to what the user is doing. If they are deleting a cell, it can't be columns 1 or 2, but it can be 1 or 2 if they are deleting a row. If they duplicate the sheet, they need to be able to copy columns 1 and 2. I can't figure out how to tell the type of action the user did in any way. I'm faking it by looking at the row the user edited and the oldValue attribute, but it's not completely accurate and my code looks very brittle. The change event function doesn't have the attributes I need like source, range, oldValue, and value.