The V8 Runtime has a problem with creating triggers by script so I need to convert to the old script template, but when trying to convert to Legacy, it doesn't save for two problems:
Original Script Part 1:
function installFunctions() {
const excludedFunctions = ["onOpen", "installFunctions"];
const menu = SpreadsheetApp.getUi().createMenu('Funções do GAS');
for (let i in this) {
if (typeof this[i] == "function" && !excludedFunctions.includes(i)) {
menu.addItem(i, i);
}
}
menu.addToUi();
}
function onOpen() {
installFunctions();
}
Not saved because it contains a Missing ; after the for-loop launcher.
error in this line of code:
for (let i in this) {
Original Script Part 2:
function deleteTriggerWithName(name) {
const trs = ScriptApp.getProjectTriggers().map(t => t.getHandlerFunction());
const ts = ScriptApp.getProjectTriggers();
ScriptApp.deleteTrigger(ts[trs.indexOf(name)]);
}
Not saved because it contains a Syntax Error
in this line of code:
const trs = ScriptApp.getProjectTriggers().map(t => t.getHandlerFunction());