Activate a google apps script at a certain time every day?

Viewed 1295

I'm coding an application that will automatically open the launch meeting page for my next class, thus automatically joining me into the class ZOOM when it is time, but I'm not sure how I would go about doing the timings, I would need multiple triggers, at 9:00, at 10:20, at 11:40, at 1:00, and at 2:20, and not have them activate on saturdays or sundays. Any pointers?

2 Answers

There are something that we call Triggers in Google Apps Script. Specifically, you will need a time based trigger.

Sample code using time based trigger:

function createTimeDrivenTriggers() {
    // Trigger every Monday at 09:00.   
    ScriptApp.newTrigger('myFunction')
        .timeBased()
        .onWeekDay(ScriptApp.WeekDay.MONDAY)
        .atHour(9)
        .create(); 
}

For more info, please see documentation

Related