Last active
January 14, 2019 10:10
-
-
Save tanshio/77e21a7c03fb2a09f21c to your computer and use it in GitHub Desktop.
gas trigger
This file contains 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
//https://groups.google.com/forum/#!msg/google-apps-api-japan/sbXlShVOGiw/9Bl3i1s1ch8J | |
function deleteTrigger(triggerKey) { | |
triggerKey = triggerKey || "triggerId"; | |
// ああああああああ | |
var triggerId = ScriptProperties.getProperty(triggerKey); | |
if(!triggerId) { | |
return; | |
} | |
ScriptApp.getScriptTriggers().filter(function(trigger){ | |
//var trigger = ScriptApp.getScriptTriggers()[0]; | |
return trigger.getUniqueId() == triggerId; | |
}) | |
.forEach(function(trigger) { | |
ScriptApp.deleteTrigger(trigger); | |
}); | |
ScriptProperties.deleteProperty(triggerKey); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment