How to open a URL in a new tab that is launched by selecting a check box?
I have a table as in the screenshot attached, I want me to open the link from the cell on the right in a new tab after changing the checbox enter image description here
I tried to use this script,
function openTab() {
var selection = SpreadsheetApp.getActiveSheet().getActiveCell().getValue();
var html = "<script>window.open('" + selection + "');google.script.host.close();</script>";
var userInterface = HtmlService.createHtmlOutput(html);
SpreadsheetApp.getUi().showModalDialog(userInterface, 'Open Tab');
}
but I don't know how to:
- tag the script to only be active on one selected sheet
- get the link from the cell next to it