Tuesday 22 November 2022

Filter a try/catch error message

The following Google Apps Script is designed to exercise how you might go about searching the error message in a 'try/catch' for keywords. I wanted this specifically for a tool I built that contains a lot of code (and hence a lot of potential error messages) between a try/catch, for which a very small number of people were experiencing a timezone issue with their Google Sheet file.

The aim was to use a JavaScript 'match' to find the keyword timezone and display a set of instructions for the user to resolve the issue themselves instead of just a generic error message. The below Apps Script code is a simplified version of all of that aimed at just getting a file and using a typo in the code to trigger an error.

Filter an error message in a try/catch
Filter an error message in a try/catch

Tuesday 8 November 2022

Bulk convert Google Sheets to PDFs

As of February 2023 'Convert Drive Files' is now available as a Google Workspace Marketplace Add-on.

The following Google Apps Script tool is designed to bulk convert all Google Sheets (only) within a given Google Drive folder into PDFs. You can choose the destination folder for the PDFs to be put into and also whether you want the original Sheets to be deleted.

Bulk convert Google Sheets to PDFs using Apps Script
Bulk convert Google Sheets to PDFs using Apps Script