Is there a way to mimic the onclick
function using google app script?
I already checked online but could not anything in the official documentation, and the only useful post in StackOverflow is the following: How can you monitor for click events in Google Apps script for spreadsheets? but it's an old post from 2013.
Does anyone know if anything changed since then?
You can use a simple onSelectionChange trigger for that.
Just add a function named on onSelectionChange
and save the project. From now on, every time a different cell is selected, this function will execute.
function onSelectionChange(e) {
console.log("A NEW CELL WAS SELECTED!");
console.log(JSON.stringify(e));
}
JSON.stringify(e)
, as shown in the sample above.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With