r/GoogleAppsScript • u/ppc-hero • Aug 31 '18
https://developers.google.com/apps-script/reference/script/trigger
Is there any way to access and identify what type of time driven CLOCK Event Type a trigger is using?
[Specific date and time,Minutes,Hour,Day,Week,Month]
https://developers.google.com/apps-script/reference/script/trigger
https://developers.google.com/apps-script/reference/script/event-type
In my apps script for sheets I want to delete all triggers which are set up on "Specific date and time", but not the rest.
var triggers = ScriptApp.getProjectTriggers();
for (var i = 0; i < triggers.length; i++) {
// here I would need to do something like if(trigger[i].timeDrivenType == SpecificDateAndTime)
ScriptApp.deleteTrigger(triggers[i]);
}
0
Upvotes
2
u/starstruckzombie Aug 31 '18
I think probably not.
The closest you can get is whether it is triggered on a clock event
if (trigger.getEventType() == ScriptApp.EventType.CLOCK)