I have a spreadsheet that has a function to call an HTML dialog to choose some dates:
htmlDate = HtmlService.createHtmlOutputFromFile('datePicker')
.setHeight(120)
.setWidth(550);
SpreadsheetApp.getUi().showModalDialog(htmlDate, 'Select the dates for presentation:');
This is the part of the HTML code that defines the actions of buttons in datePicker.html:
<input type="button" onClick="submitForm()" value="OK" />
<input type="button" onClick=google.script.host.close() value="Cancel" />
And this is the part of HTML code that calls my function 'newPresentation':
<script type="text/javascript">
function submitForm() {
google.script.run.newPresentation(document.forms[0]);
Utilities.sleep(1000);
google.script.host.close();
}
</script>
The problem is that: When I run the script, it works perfectly. First, it calls my function 'newPresentation', and then it closes itself, running the rest of the script. In function 'newPresentation' there are other HTML dialogs that are called up.
But, when another user runs the script, this HTML dialog doesn't close itself. Even though it doesn't close itself, the rest of the script is executed normally. I have already shared the spreadsheet with another user, with edit privileges. Both me and the other user are logged in a Google Account.
Some idea how to fix that problem?
PS.: Sorry for some grammatical errors, but I'm not fluent in english.