I want to add a method stop process() to interupt and terminate currently running appScript script.
I removed all trigger, but it's not enough as the main thread (which wasn't trigger) is not to be seen on the triggers UI and hence continues running.
function stop(){
removeAllTriggers();
exit;
}
function removeAllTriggers() {
try {
var triggers = ScriptApp.getProjectTriggers();
for (var i = 0; i < triggers.length; i++) {
// delete all triggers
ScriptApp.deleteTrigger(triggers[i]);
}
}
catch (e) {
SpreadsheetApp.getActiveSpreadsheet().toast('Failed to cleanup triggers', '', TOAST_DISPALY_TIME);
};
}
Is there a way to run exit; ?