This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function deleteAllTriggers () | |
| { | |
| // Deletes all triggers in the current project. | |
| var triggers = ScriptApp.getProjectTriggers(); | |
| for (var i = 0; i < triggers.length; i++) { | |
| ScriptApp.deleteTrigger(triggers[i]); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function createTimeDrivenTriggers() { | |
| ScriptApp.newTrigger('listFilesInDrive') //run "listFilesInDrive()" every 5 minutes | |
| .timeBased() | |
| .everyMinutes(5) //Runs every 5 minutes | |
| .create(); | |
| }; | |
| function listFilesInDrive() { | |
| var scriptProperties = PropertiesService.getScriptProperties(); | |
| var MAX_FILES = 3; //use a safe value, don't be greedy! |