Is it possible to automate Google Spreadsheets Scripts (e.g. without an event to trigger them)?

后端 未结 3 1106
你的背包
你的背包 2020-12-29 04:13

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 a

相关标签:
3条回答
  • 2020-12-29 04:52
    function createTimeDrivenTriggers() {
      // Trigger every 6 hours.
      ScriptApp.newTrigger('getEmails')
          .timeBased()
          .everyHours(1)
          .create();
    }
    
    0 讨论(0)
  • 2020-12-29 05:01

    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.
    0 讨论(0)
  • 2020-12-29 05:14

    It's actually possible. Have a look at http://code.google.com/googleapps/appsscript/guide_events.html#Installable

    0 讨论(0)
提交回复
热议问题