How can I give other Google Sheets viewers visual feedback that a script is running?

  Kiến thức lập trình

Background:
I have a dashboard-style google sheet for my organisation that shows clients and their time log entries and some analysis. The time entries are being imported from a time tracking service with an app script function I’ve written. All in all it takes about 3/4 minutes for the function to complete.

When I run the function on click from a menu button, I get the dark grey box telling me a script is running. Other users looking at the spreadsheet don’t see this, nor do they know the script is running. It would probably be best practice to show them a message somehow that the script is running.

My initial thoughts were, ‘could I add a fixed position <div> or an overlay somewhere in the window that gives them a message?’, but I’m not sure I can do this with app script. I could update a cell value with a message but the dashboard has a lot of sheets so this isn’t ideal. I could also run an alert on edit or on open, but the spreadsheet is basically always open for team members and if it were on edit then users wouldn’t see the message until they tried to do something.

The question:
I want to give all spreadsheet viewers some sort of visual feedback that a script is running. Does anybody have any good ideas for this?

New contributor

Martin Stephens is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT