Skip to content

Instantly share code, notes, and snippets.

@glasnt
Forked from rheajt/Code.gs
Created December 10, 2018 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glasnt/2dda5c62750d17c65f1d1b1fc89a29dd to your computer and use it in GitHub Desktop.
Save glasnt/2dda5c62750d17c65f1d1b1fc89a29dd 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