Pages

Saturday, 5 October 2019

While loop with a Sleep and Toast

The following Google Apps Script is 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.
Screenshot of toast notification in Google Sheet
Screenshot of toast notification in Google Sheet

While loop with a Sleep and Toast.xlsx

No comments:

Post a comment