LANG SELRCT

Apps Script Reference  (Create: Create new Spreadsheet | Create new Apps Script

Monday, May 6, 2019

1時間毎に実行するトリガーをスクリプトで書きたい


1時間ごとにmyFunctionを実行するトリガーをスクリプトで書きたくて



コード.gs
function createTriggers1mins() {
  var trigger = ScriptApp.newTrigger('myFunction')
    .timeBased()
    .everyhours(1)
    .create();
}  

function myFunction() {
  console.log("log: " + new Date()); 
}


参考

timeBased()
https://developers.google.com/apps-script/reference/script/trigger-builder#timeBased()

Latest post

Extracting data from Google Sheets with regular expressions

Introduction Regular expressions are a powerful tool that can be used to extract data from text.  In Google Sheets, regular expressions ca...