Переход по ссылке при изменении в листе
Мне нужно чтобы при любом изменении в листе sheet1 осуществлялся переход по ссылке. У меня имеется следующий код:
function onEdit(e){
var changedSheet = e.range.getSheet();
var sheet = 'sheet1';
if(changedSheet.getName()===sheet){
var link = "<script> window.open('https://www.google.com/');</script>";
var html = HtmlService.createHtmlOutput(link)
SpreadsheetApp.getUi().showModelessDialog(html,'Loading...');
var output = HtmlService.createHtmlOutput('<script>google.script.host.close();</script>');
SpreadsheetApp.getUi().showModalDialog(output, 'Close...');
}
}
Подскажите, каким образом заставить код работать.
Ответы (1 шт):
Автор решения: Taras Ivaniv
→ Ссылка
Решил похожую проблему так. Открывается sidebar на пару сек, и после закрывается:
var js = "<script> document.location.href = 'tel:"+repla+"'; google.script.host.close(); </script>";
var html = HtmlService.createHtmlOutput(js);
SpreadsheetApp.getUi().showSidebar(html);