Answer:
You can create an installable trigger to run every day without needing to have your Spreadsheet open.
Details:
Using a time-based installable trigger you can have your function run daily, though as per the documentation:
The time may be slightly randomized — for example, if you create a recurring 9 a.m. trigger, Apps Script chooses a time between 9 a.m. and 10 a.m., then keeps that timing consistent from day to day so that 24 hours elapse before the trigger fires again.
If this is not a problem for you, then you can do this from the Apps Script Editor for your project - follow the path Edit > Current project's triggers
which will open the triggers page for the project in a new tab.
In the bottom left, click on the + Add Trigger
button to bring up the Add Trigger
modal - use hte following properties:
- Choose which function to run:
updateNote()
- Choose which deployment should run:
Head
- Select event source:
Time-driven
- Select type of time based trigger:
Day timer
- Select time of day:
10am to 11am
If running at exactly 10:35 is important to you:
You can follow the same steps as above, but with slightly different properties:
- Choose which function to run:
createTimeDrivenTriggers()
- Choose which deployment should run:
Head
- Select event source:
Time-driven
- Select type of time based trigger:
Day timer
- Select time of day:
9am and 10am
With this, you'll be creating your time-based trigger to run at 10:35 on a daily basis, always running before the trigger needs to fire.
References: