Apps Scriptリファレンス: Apps Script Reference |障害・課題追跡: IssueTracker |Google Workspace: Status Dashboard - Summary

2019年5月6日月曜日

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

スプレッドシートの空白セルを直前の値で埋めたい

A列の空白セルに直前の値を入れたくて書いたコードです スプレッドシートに以下のようなBeforeの表があるとき (A列に空白セルがある) Before 1 A B 2 エリア 都市 3 東京 新宿 4 渋谷 5 池袋 6 神奈川 横浜 7 川崎 8 相模原 9 千葉 千葉 10 ...