[英]Google Apps Script Trigger 1st thursday of every month
I am trying to create a trigger to run on the 1st Thursday of every month but cant seem to get this to work correctly. 我正在尝试创建一个触发器,使其在每个月的第一个星期四运行,但似乎无法使其正常工作。 I know how to create the weekday trigger:
我知道如何创建工作日触发器:
ScriptApp.newTrigger('myFunction')
.timeBased()
.onWeekDay(ScriptApp.WeekDay.THURSDAY)
.atHour(9)
.create();
But I don't know how to specify that this needs to be the first Thursday of every month. 但是我不知道如何指定这必须是每个月的第一个星期四。 I would assume I can use an IF statement and say if the date is less than 7 it should run, but that seems overly complicated.
我假设我可以使用IF语句,并说如果日期小于7,则应运行该语句,但这似乎过于复杂。 Any help is appreciated!
任何帮助表示赞赏!
@Ben, nested time trigger in Class ClockTriggerBuilder cannot be done and is only fixed in some time trigger. @Ben,类ClockTriggerBuilder中的嵌套时间触发器无法完成,只能在某个时间触发器中解决。 Here is the link for more details .
这是更多详细信息的链接。 You can find other triggers for your apps Script like snippet .
您可以为您的应用程序脚本snippet找到其他触发器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.