I am trying to create a Google Document that has complex questions we ask clients. I want to add a link at the end of each question that will launch a pop-up for additional information.
I currently have a .gs file that houses the script below:
function showDialog() {
var html = HtmlService.createHtmlOutputFromFile('Help File.html')
.setWidth(400)
.setHeight(300);
DocumentApp.getUi() // Or DocumentApp or FormApp.
.showModalDialog(html, <b>Hello World!</b> );
}
I also have a .html file with the following code:
< div>
Hello, world!
< input type="button" value="Close" onclick="google.script.host.close()" />
< /div>}
Is there a way to embed this into a link on the Google Doc? Currently, I am able to click "Run" from the Google Apps Script to make the pop-up window work.
.showModalDialog()
there's no separate window with its own URL. See my answer below.