Screenshot of spreadsheet data used for creating emails |
I'm Phil Bainbridge and I aim to share my experiences of IT projects I've worked on as I continue to learn and develop, through this blog. My main coding language is Google Apps Script (with JavaScript), but there is also some: PowerShell, HTML, SQL and jQuery.
Friday, 27 September 2019
Bulk send emails from Google Sheet
The following Google Apps Script 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.
Thursday, 26 September 2019
Search Google Calendar date range for specific events
The following Google Apps Script builds on this previous post for searching Google Calendar for event details by expanding the search scope to a date range and including search criteria to narrow down the results.
There are only a couple of extra lines to add since we did most of the work in the previous blog post.
There are only a couple of extra lines to add since we did most of the work in the previous blog post.
var options = {search: 'Test'};So this time we can specify further criteria when getting events - like searching for the text Test and providing a start/end date.
var allEvents = calendar.getEvents(startDate, endDate, options);
Sunday, 15 September 2019
Remove HTML tags in a cell by a regex
The following Google Apps Script is designed to remove all HTML tags within the content of a cell by using a regular expression (regex). It was developed as a more advanced version of this HTML email body blog post in that it could dynamically remove various instances of HTML tags used (eg <font></font>, <br />, <strong></strong>) all in one go.
The regex uses 'replace' to identify the HTML tags and remove then (or technically replace them with nothing):
Screenshot of cell containing HTML tags and text |
The regex uses 'replace' to identify the HTML tags and remove then (or technically replace them with nothing):
var cleanContent = cell.replace(/<[^>]+>/mg,"");
Saturday, 14 September 2019
Split single cell contents with new line
The following Google Apps Script is designed to separate the contents of a cell that have been entered on a new line (by pressing Alt + Enter in Windows). In this example there are 3 email addresses in the one cell that we want to 'split' up so we can extract each one individually.
Screenshot of cell with content added via a new line |
Saturday, 7 September 2019
Bulk rename files in Google Drive
As of February 2022 this tool is now available as a Google Workspace Marketplace Add-on.
Download
As of February 2022 this is now available as a Google Workspace Marketplace Add-on.
Subscribe to:
Posts (Atom)