AppsScriptPulse

‘While’ loop with a ‘Sleep’ and ‘Toast’

Screenshot of toast notification in Google Sheet
Screenshot of toast notification in Google Sheet

Understanding how to use a simple ‘while’ loop that pops up a ‘toast’ message every 5 seconds by making use of ‘Utilities.sleep’ to pause the script.

This was created as part of some testing for another script designed to bulk move files between Google Drive folders. Without the toast notification it was difficult to determine the progress being made, so adding it in allowed for the name of the file last copied to be displayed to the user. This script removes all of the extra features and shows the basic while loop and toast.

Source: The Gift of Script: While loop with a Sleep and Toast

Leave a Reply

Your email address will not be published. Required fields are marked *