Santhosh cbe
Santhosh cbe

Reputation: 51

How to show the Load Indicator while running the google app script

enter image description here

How to show the Load Indicator while running the google app script

Upvotes: 5

Views: 6437

Answers (1)

Raserhin
Raserhin

Reputation: 2686

If you want to stop the interaction with the sheets while the image is showing and the is executing you could try to use the UI method showModalDialog().

So something like this would do the trick for what you are trying to achieve:

function showDialog() {

  var ui = SpreadsheetApp.getUi();
  // Display a modal dialog box with custom HtmlService content.
  var htmlOutput = HtmlService
    .createHtmlOutput('<img src=https://i.sstatic.net/AuqJU.gif>')
    .setWidth(250)
    .setHeight(300);
  ui.showModalDialog(htmlOutput, 'Script Running');


}

If you want to have more control over the closing of the dialog you will need to do it from the client side. Modifying the HTML object inside the showModalDialog(). In case you are interested in that I would suggest to take a look into this question.

You can also check the Apps Script documentation about dialogs and other UI elements.

Upvotes: 4

Related Questions