This is the first part of a larger script, but I need to get the email address of the person making edits to the cell. For the example I am just trying to add the editors email as a comment to the cell that was edited.
I know that the onEdit() runs in authMode=LIMITED which is the issue. And an installable trigger will also not work as it will only return the person who created the script and not the editor of the cell.
This means the below works for the owner of the script if I manually get them to authorize it, but will not work for any editors of the script.
I think I can get this to work if there is a way to force a user to authorize themselves on first edit.
function onEdit(e){
Logger.log(e);
var range = e.range;
var email1 = Session.getActiveUser().getEmail();
var email2 = Session.getEffectiveUser().getEmail();
range.setNote('Active User: ' + email1 + '\nEffective User: '+ email2);
}