title: Scheduling Google App Script function for specific recurring windows
body: <p>I'm trying to schedule an Apps Script function. I need the email to trigger Mon-Sat every 2 hours starting at 11am-9pm.</p>
  
  <p>I've written the following code to create triggers for each day:</p>
  
  <pre><code>function createTriggers() {
  
    var days = [ScriptApp.WeekDay.MONDAY, 
                ScriptApp.WeekDay.TUESDAY,
                ScriptApp.WeekDay.WEDNESDAY, 
                ScriptApp.WeekDay.THURSDAY, 
                ScriptApp.WeekDay.FRIDAY,
                ScriptApp.WeekDay.SATURDAY];
  
    for (var i=0; i&lt;days.length; i++) { 
      ScriptApp.newTrigger('emailDashboard')
        .timeBased().onWeekDay(days[i])
        .everyWeeks(1).everyHours(2).create();
    }
  }
  </code></pre>
  
  <p>When I run what I have above, I get the following error:</p>
  
  <blockquote>
    <p>"The recurrence interval on the clock trigger has already been set. (line 79, file "Code")" </p>
  </blockquote>
  
  <p>I cant find anything about that response, and it doesn't actually create the trigger. I assume what I have above would get me the email Mon-Sat, every 2 hours. I'm not sure how to go about starting at 11am central and ending at 9pm central.</p>