Hi I have the following code:
function onEdit(e) {
if (e.value == "Requested") {
var number = 50; // Number of blink
for (var i = 0; i <= number * 2; i++) {
if (i % 2 == 0) {
var color = "white";
} else {
var color = "red";
}
e.range.setBackground(color);
SpreadsheetApp.flush();
Utilities.sleep(1500); // Blink speed (ms)
}
e.range.setBackground("white") // Cell color is white after blinks were completed.
}
}
However for some reason the cell blinks less than 10 times or so even though I have set it to 50. Is there a time limit when google runs a for loop? Is there a way to make it indefinite until I change the cell value to something else?