I’m working with a function that looks like this:
function editTrigger(e) {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var currentSheet = spreadsheet.getSheets()[0];
// Fetches the currently selected range
var selectedRange = currentSheet.getActiveRange();
Logger.log(selectedRange.getA1Notation());
}
Currently, this function is activated during a ‘change’ event in my spreadsheet. Initially, it was set to ‘on edit’ (hence the name), which doesn’t respond to background color changes, a crucial aspect of my task.
Every time it runs, the log always outputs A1 regardless of the active selection, and the same issue occurs when I replace getActiveRange() with getActiveCell().
Is there a method to access the actual selected range when the script executes?