是否可以自动执行Google Spreadsheets脚本(例如,没有事件触发它们)? [英] Is it possible to automate Google Spreadsheets Scripts (e.g. without an event to trigger them)?

查看:150
本文介绍了是否可以自动执行Google Spreadsheets脚本(例如,没有事件触发它们)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道是否可以使用Google Apps脚本运行而无需手动事件?意思 - 我想建立一个电子表格,在指定的时间每天发送一份表格。我已经想出了如何通过执行脚本来手动发送表单,但Google是否实现了将脚本设置为将来运行(以及定期)的功能?



谢谢...

解决方案

现在可以添加基于时间的事件。



来自: http://code.google.com/googleapps/appsscript/guide_events.html




  • 选择触发器>当前脚本的触发器。您会看到一个面板,其中显示消息No triggers set up。点击此处立即添加一个。

  • 点击链接。

  • 在运行下,选择您希望按计划执行的功能。 b $ b
  • 在事件下,选择时间驱动。

  • 在出现的第一个下拉列表中,选择周计时器,日计时器,小时计时器或分钟计时器。根据您选择的内容,您会看到一个或两个附加列表。要测试触发器和您的功能,您可能希望选择一个较短的时间段,以便您可以看到执行而不必等待几个小时或几天。 如果选择了周计时器,请选择
  • 如果您选择了Day定时器,请选择一个小时。

  • 如果选择了小时定时器,请选择一个时间间隔

  • 如果您选择分钟计时器,请选择分钟间隔。

  • 单击保存。 >要确保脚本在特定时区的正确时间运行,请单击文件>属性,选择时区,然后单击保存。


Does anyone know if it's possible to use Google Apps Scripts to run without needed a manual event? Meaning - I would like to set up a spreadsheet to send a form every day at a specified time. I have figured out how to manually send the form by executing a script, but has Google implemented to ability to set a script to run in the future (and on a recurring basis)?

I have searched for an answer but can't find one.

Thanks...

解决方案

Now it is possible to add time based events.

from: http://code.google.com/googleapps/appsscript/guide_events.html

  • Choose Triggers > Current script's triggers. You see a panel with the message No triggers set up. Click here to add one now.
  • Click the link.
  • Under Run, select the function you want executed on schedule.
  • Under Events, select Time-driven.
  • On the first drop-down list that appears, select Week timer, Day timer, Hour timer, or Minutes timer. Depending on which you select, you see one or two additional lists. To test the trigger and your function, you might want to pick a short duration so that you can see the execution without having to wait hours or days.
  • If you picked Week timer, select a day of the week and time of day.
  • If you picked Day timer, select an hour.
  • If you picked Hour timer, select an interval of hours.
  • If you picked Minutes timer, select an interval of minutes.
  • Click Save.
  • To ensure that the script runs at the correct time for a particular time zone, click File > Properties, select a time zone, and click Save.

这篇关于是否可以自动执行Google Spreadsheets脚本(例如,没有事件触发它们)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆