Is it possible to automate Google Spreadsheets Scr

2019-02-03 08:18发布

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...

4条回答
聊天终结者
3楼-- · 2019-02-03 09:05
function createTimeDrivenTriggers() {
  // Trigger every 6 hours.
  ScriptApp.newTrigger('getEmails')
      .timeBased()
      .everyHours(1)
      .create();
}
查看更多
爷的心禁止访问
4楼-- · 2019-02-03 09:11

No, that is not possible. Cronjobs are available only in Google App Engine. What is possible, is invoking a script from distance (have not tried it), so you might use an own built application to call a script function.

查看更多
\"骚年 ilove
5楼-- · 2019-02-03 09:18

Now it is possible to add time based events.

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

  • Edit -> Current project'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.
查看更多
登录 后发表回答