Google Apps Script to open a URL

后端 未结 5 587
梦谈多话
梦谈多话 2020-11-22 10:39

Is there a way to write a google apps script so when ran, a second browser window opens to www.google.com (or another site of my choice)?

I am trying to come up with

5条回答
  •  面向向阳花
    2020-11-22 11:23

    window.open(url)1 does open web pages automatically, provided pop- up blockers are disabled(as is the case with Stephen's answer)

    openUrl.html

    
    
      
       
        
      
      
        Kindly allow pop ups
    Or Click here to continue!!!

    code.gs:

    function modalUrl(){
      SpreadsheetApp.getUi()
       .showModalDialog(
         HtmlService.createHtmlOutputFromFile('openUrl').setHeight(50),
         'Opening StackOverflow'
       )
    }    
    

提交回复
热议问题