每天8:00、12:30、17:00运行Gmail Google Apps脚本

编程入门 行业动态 更新时间:2024-10-18 22:28:36
本文介绍了每天8:00、12:30、17:00运行Gmail Google Apps脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我每天需要运行三次Google Apps脚本:8:00、12:30、17:00.

I need to run a Google Apps script three times a day: at 8:00, 12:30, 17:00.

如何执行此操作?

我已经看过Triggers,更具体地说是Time driven:

I have already looked at Triggers, and more specifically Time driven:

  • 小时计时器,但此处未适应Every hour,Every 2 hours,Every 4 hours

日间计时器,但是8am to 9am不太精确,我希望更精确一些,而且12:30也不可能

Day timer, but then 8am to 9am is not very precise, I would prefer something more precise, and also 12:30 is not possible

特定时间,但是YYYY-MM-DD HH:MM不适合每天运行

Specific time, but then YYYY-MM-DD HH:MM is not adapted to run it daily

From calendar触发器似乎也没有适应.

From calendar triggers does not seem adapted either.

推荐答案

使用 nearMinute()和atHour():

const createTrigger = ([hour, minute])=> ScriptApp.newTrigger("myFunction") .timeBased() .atHour(hour) .nearMinute(minute) .everyDays(1) .create(); [[8,0],[12,30],[17,0]].forEach(createTrigger)

更多推荐

每天8:00、12:30、17:00运行Gmail Google Apps脚本

本文发布于:2023-11-27 04:09:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636530.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   Apps   Google   Gmail

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!