Long-running menu actions feel broken without feedback. SpreadsheetApp.toast pops a small notice in the lower-right — perfect for "started / done / N rows" without opening a dialog.
What you'll need
- A container-bound spreadsheet script (toasts need an active spreadsheet)
- A short message users will actually read
How to use this snippet
function sheetToast(message, title, timeoutSeconds) {
title = title || 'NitroGAS';
timeoutSeconds = (timeoutSeconds == null) ? 5 : timeoutSeconds;
SpreadsheetApp.getActiveSpreadsheet().toast(message, title, timeoutSeconds);
}
function syncFromMenu() {
sheetToast('Starting sync…', 'Import', 3);
// … work …
sheetToast('Done — 42 rows updated', 'Import', 5);
}
Tips:
- Keep messages short; toasts aren't a log viewer.
- Pass
-1as timeout to keep the toast until the user dismisses it (handy for errors).
Happy Coding!
