Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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');
}
@paul-kline

This comment has been minimized.

Copy link

commented Apr 11, 2018

nice nice.

@urwa

This comment has been minimized.

Copy link

commented Jul 30, 2018

Awesome!

@stndstn

This comment has been minimized.

Copy link

commented Oct 17, 2018

Thanks

@raulsananes

This comment has been minimized.

Copy link

commented Apr 5, 2019

Awesome! Worked perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.