I use Google Apps Script to support staff and students in my job. I enjoy dabbling with creating tools to help with automation and I freely share my learning experiences on my blog, where I also have a number of useful Google Add-ons: www.pbainbridge.co.uk
For those getting a ‘date’ from a Google Form and finding that it flips the day/month the wrong way around. This small piece of code can be inserted to create a correct date format.
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.
Screenshot of coloured columns to highlight actions
This is designed to clear the adjacent cell to the right of the one that has just been edited – so long as it is within the column we specify.
It was developed as I was testing the available options for a Stock Inventory system where an item that was to be marked as back in stock would automatically clear an email timestamp in the adjacent cell (ready for the whole ordering process to start again).
The script is designed to bulk create folders from a Google Sheet and to arrange them into alphabetised folders within Google Drive, by extracting the first letter of a user’s surname.
If a suitable alphabetised folder does not exist in Google Drive, then one is created. The script also adds the created folder to an ‘Everybody’ folder so that there is a single area with all the folders listed in.
This is designed to automate bulk renaming of multiple files within a single Google Drive folder. It has been developed as a Google Sheet with flexibility towards entering your own search pattern and replacement string as you see fit.
This is designed to loop through each row of a Google Sheet and send an email containing information from it. This means you can send personalised emails with ad-hoc information for each recipient quickly.
It has been developed so that it is easily expandable for you to add further columns/rows. The script has a number of features to achieve this:
A menu option for easily selecting to send email, with a confirmation dialogue popup.
A timestamp as confirmation for when an email was sent.
A check that an Email Address is present and there is no current value in the Email Sent column – to prevent repeat email sending but also allow ad-hoc emailing by clearing this column for those you wish to send again.
A try/catch to help automatically deal with problematic emails that may break the script – an error message will be written into the Email Sent column and the script will continue on to the next row.
The following Google Apps Script code was developed to bulk create Google Drive folders with data from a given spreadsheet (eg to name the folders and add permissions). It uses the Module Name and Marker to form the folder name as it iterates through each row in turn. At the same time it takes the Marker Email Address and uses the ‘DriveApp’ to provide edit access to the folder. Finally it creates another sub-folder in each folder as an extra.