---
title: "Executing Function with Minutes timer in Specific Times using Google Apps Script [and tips on creating triggers in V8]"
author: "Martin Hawksey"
date: 2021-10-03T10:45:16+00:00
modified: 2021-10-03T10:45:21+00:00
canonical_url: https://pulse.appsscript.info/p/2021/10/executing-function-with-minutes-timer-in-specific-times-using-google-apps-script-and-tips-on-creating-triggers-in-v8/
markdown_url: https://pulse.appsscript.info/p/2021/10/executing-function-with-minutes-timer-in-specific-times-using-google-apps-script-and-tips-on-creating-triggers-in-v8.md
categories:
  - "Gotchas"
  - "Intermediate"
  - "Solutions"
  - "V8"
tags:
  - "tanaikech.github.io"
featured_image: https://pulse.appsscript.info/files/2021/10/fig1.png
description: "A clever bit of coding from Kanshi Tanaike for running a Google Apps Script on a defined schedule. The part I found particularly interesting was the solution for programmatically setting triggers in the V8 runtime. For the sample code and explanation visit the source link."
---

# Executing Function with Minutes timer in Specific Times using Google Apps Script [and tips on creating triggers in V8]

![Executing Function with Minutes timer in Specific Times using Google Apps Script [and tips on creating triggers in V8]](https://pulse.appsscript.info/files/2021/10/fig1.png)

> [https://tanaikech.github.io/2021/09/22/executing-function-with-minutes-timer-in-specific-times-using-google-apps-script/](https://tanaikech.github.io/2021/09/22/executing-function-with-minutes-timer-in-specific-times-using-google-apps-script/)
> This is a sample script for executing a function with the minutes timer in the specific times using Google Apps Script. For example, when this sample script is used, the following situation can be achieved: Execute a function every 10 minutes only in 09:00 – 12:00 and 15:00 – 18:00 for the weekday.

A clever bit of coding from Kanshi Tanaike for running a Google Apps Script on a defined schedule. The part I found particularly interesting was the solution for programmatically setting triggers in the V8 runtime:

> This sample script used Web Apps. Because when v8 runtime is used, when the trigger is set from the function executing by a trigger, the trigger is disabled. This is the recognized bug. But unfortunately, this has still not been resolved. (September 21, 2021) **But, when the trigger is installed by Web Apps, no issue occurs.** So, please deploy Web Apps.

For the sample code and explanation visit the source link.

Source: [Executing Function with Minutes timer in Specific Times using Google Apps Script**](https://tanaikech.github.io/2021/09/22/executing-function-with-minutes-timer-in-specific-times-using-google-apps-script/)

---

*Published by [Martin Hawksey](https://pulse.appsscript.info/p/author/admin/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2021/10/executing-function-with-minutes-timer-in-specific-times-using-google-apps-script-and-tips-on-creating-triggers-in-v8/](https://pulse.appsscript.info/p/2021/10/executing-function-with-minutes-timer-in-specific-times-using-google-apps-script-and-tips-on-creating-triggers-in-v8/)*
