I have a column of links in Google Sheets, let's just say they're in C2:C11 for now. What I want is a cell that when clicked on or executed or whatever will go through the list and open all of them as webpages. I'd prefer to open them in Chrome, but the default browser (which is also Chrome) works too.
I know that the equivalent in python would be:
for link in column:
webbrowser.open(link)
but not how to translate that into Sheets functions.
Edit:
With @DevenRamini, I was able to write the following:
function myFunction() {
var range = SpreadsheetApp.getActiveSheet().getRange("H2:H7");
var links = range.getValues();
for (var i = 0; i < links.length; i++){
var link = links[i][0];
console.log(link);
var html = "<script>window.open('" + link + "');google.script.host.close();</script>";
var userInterface = HtmlService.createHtmlOutput(html);
SpreadsheetApp.getUi().showModalDialog(userInterface, 'Open Tab');
};
}
It almost works, but it's only opening one tab and that tab is the last link in the column.