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

Creating a template copier app in Google Apps Script

Introduction This article will show you a template copier application in Google Apps Script.  This application will automatically copy a t...