Is it possible to close a UI window that has opened in Apps Script?
I think the answer is no per: http://code.google.com/p/google-apps-script-issues/issues/detail?id=474&can=1&q=.close%28%29&colspec=Stars%20Opened%20ID%20Type%20Status%20Summary%20Component%20Owner
but I wanted to see if there were other opinions.
I have a "Waiting window" that pops up, that I want to close when the activity is finished.
var app = UiApp.getActiveApplication();
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = getSheetWithSubmissions(ss);
// create UI app, this works fine
app = createWaitPleaseUI(sheet);
ss.show(app);
//simulated activity
Utilities.sleep(5000);
//this doesn't work despite being in the documentation
app.close();
Think this is not possible but wish Google would dump it from their documentation if it can't be done.
As a workaround, I can bring up a second GUI saying "work complete, click OK" and then it works fine.
You have to return the app object for any changes to be updated to it, even closing.
Change your last line to return app.close() instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With