0

I am trying to update the text in a Google Sheets addon rather than creating a completely new toast in a progress bar.

I'm using the code from this tutorial by Jacorre: https://www.jacorre.com/tutorial/display-message-google-documents-spreadsheets/ and the documentation https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet#toast(String,String,Number)

for (var i = 1; i <= numRows; i++) {

    var progress = i/numRows;

    progress = progress.toFixed(2);
    progress = progress *100;

    SpreadsheetApp.getActiveSpreadsheet().toast("Processing: " + progress + "%","Some Title",-1);

The above still creates a "flashing" animation, where a new toast is painted with each interation. Is there a way to update this without the "slide-in" animation?

1 Answer 1

1

I didn't know this but it looks like you can set the time delay to negative and it will stay up until dismissed. I'm not sure if you can write to it during that period however.

Reference

Let me know how it works out.

1
  • Hi Cooper, you are referencing the same document that I was using. I had tried using the -1 flag, but that does not change the behavior. It just means that at the final toast will remain until dismissed by the user. The weird thing is that I know it must work, as the add-on "Document Studio" is using it in that way and there it does not repaint. Unfortunately I was unabel to get in touch with the developer so far.
    – RobSteward
    May 16, 2019 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.