Dear
ChiefChippy2
Thank you so much for the suggestion.
I didn't know Properties Service.
Thanks.
Unfortunately I always find obstacles bigger than me.
If I haven't misunderstood you approach could be:
Script write actual Date in Properties Service when script finish.
-this will be the date of last execution (DateLastExecution)-
Every hours a trigger read DateLastExecution and perform a difference
form actual Date and DateLastExecution
If difference is > 24 then....perform a function
At end of script the DateLastExecution will be replaced with actual Date.
My problem is ...
It's possible to manage as date (and not string) the value written in Properties Service ?
Because if I try this code
//write last executio date
var LastExecutionDate = new Date();
var userProperties = PropertiesService.getUserProperties();
userProperties.setProperty('SchedulazioneDay', LastExecutionDate);
//perform difference
TODAY = new Date();
var Difference = (TODAY - LastExecutionDate);
the value of Difference (in the logger) is NaN.
I believe because the variable LastExecutionDate is not managed as date.
Sorry..... I don't have the gift of synthesis :D
Thanks
Grazie
Andrea