Skip to content

Instantly share code, notes, and snippets.

@Diana-Pham
Diana-Pham / deleteAllTriggers.gs
Created April 6, 2016 01:05
Deletes all triggers in Script editor
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]);
}
}
@Diana-Pham
Diana-Pham / listAllFileDetails.gs
Last active September 13, 2023 18:50
Script to list all files in your Google Drive (in a Google Sheet)
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!