I have a Google Apps script that runs every minute, performing tasks on Gmail messages.
How to have a persistant variable that I can access on subsequent calls of the script main.gs
?
I just need a simple int
variable like:
var lastaction = Math.round((new Date()).getTime() / 1000);
Then, during the next call of main.gs
, I need to check several things based on the date + elapsed time since the last action (even if the script is run every minute, an action is not necessarily performed every minute).
Note: I've already read Persistant variable in Google Apps Script but it seems a bit complicated for this simple task here (just keep an integer timestamp of the last action done by a previous call of the script)