Skip to content

Instantly share code, notes, and snippets.

@johnny3young
Forked from rheajt/Code.gs
Created August 13, 2020 04:59
Show Gist options
  • Save johnny3young/9771db4f57abd9bad87bb8947b9bdc5a to your computer and use it in GitHub Desktop.
Save johnny3young/9771db4f57abd9bad87bb8947b9bdc5a to your computer and use it in GitHub Desktop.
google apps script to open a new website in a new window
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');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment