The following Google Apps Script is designed to search a date range for Google Calendar events containing a given string (something to help target those events) and then delete them.
| Search for and delete Google Calendar events |
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.
Bulk rename Google Drive™ files quickly and easily with this Add-on. You define exactly what you want to search for in the file name and the text to replace it with. Along with options for handling special characters and append/prepend to the existing file name. Works across My/Shared drives.
| Append / Prepend to the existing file name |
Bulk convert Google Drive files quickly and easily with this Add-on. Convert between Google, Microsoft Office, PDF, etc.
Point the Add-on at a Google Drive folder, select the file types you want to convert, select your destination folder and whether you want the original file to be deleted, then hit go!
Saves having to go into each file individually, selecting the file type to download and then selecting the save destination.
Google Doc™ to PDF | Microsoft Word™ | OpenDocument Text | Rich Text Format | HTML
Google Sheet™ to PDF | Microsoft Excel™ | OpenDocument Spreadsheet
Google Slide™ to PDF | Microsoft PowerPoint™ | OpenDocument Presentation
Google Drawing™ to PDF | JPEG | PNG | SVG
Microsoft Word™ to PDF | Google Doc™ | OpenDocument Text | Rich Text Format
Microsoft Excel™ to PDF | Google Sheet™ | OpenDocument Spreadsheet
Microsoft PowerPoint™ to PDF |Google Slide™ | OpenDocument Presentation
Plain Text to Google™ Doc | Microsoft Word™
PNG | BMP to JPEG
More being added ...
Convert Drive Files Add-on webpage - includes instructions and a demo video.
The following Google Apps Script is an enhanced version of this blog post for organising files into a JavaScript Object. The difference this time however is that we are extracting 3 (not 1) pieces of information from the CSV file name and coding them into an iteratble JavaScript Object. This is more likely the process you will want to use going forwards given the extra flexibility.
The code is designed to go through a folder of Google Drive files where a number of tutors have individual files for groups of students they teach. The code will collate all of the relevant files (their IDs, the module code and group number) that belong to each tutor, so that at a later date we can loop through the organised data set and create individual Google Sheets for each tutor and compile their student data into it.
What this code ultimately allows us to achieve is the ability to go through the files and get them organised for further coding.
In this example we have a file name pattern of ModuleCode - Tutor Name - Group Number for example ABC - Jane Doe - Grp 02. So we want to collate all of the files that belong to Jane Doe first, then move on to the next tutor (Micky Mouse in this example).
The collated data will look like this:
{Micky Mouse=[{fileId=FILE ID HERE, group=Grp 05.csv, moduleCode=CDE}, {moduleCode=CDE, fileId=FILE ID HERE, group=Grp 01.csv}], Jane Doe=[{group=Grp 04.csv, fileId=FILE ID HERE, moduleCode=ABC}, {moduleCode=ABC, fileId=FILE ID HERE, group=Grp 03.csv}, {fileId=FILE ID HERE, moduleCode=ABC, group=Grp 02.csv}]}
| Files to loop through and organise |
The following Google Apps Script is designed to go through a folder of Google Drive files where a number of tutors have individual files for groups of students they teach. The code will collate all of the relevant files (specifically their IDs) that belong to each tutor, so that at a later date we can loop through the organised data set and create individual Google Sheets for each tutor and compile their student data into it.
What this code ultimately allows us to achieve is the ability to go through the files and get them organised for further coding.
In this example we have a file name pattern of ModuleCode - Tutor Name - Group Number for example ABC - Jane Doe - Grp 02. So we want to collate all of the files that belong to Jane Doe first, then move on to the next tutor (Micky Mouse in this example).
The collated data will look like this:
{"Jane Doe":["FILE ID HERE","FILE ID HERE","FILE ID HERE"],"Micky Mouse":["FILE ID HERE","FILE ID HERE"]}
| Files to loop through and organise |
The following Google Apps Script tool is designed to take a Google/Shared Drive folder full of files that you want to make a copy of and place into another set of existing Drive folders.You can decide if you want the subfolder name appending/prepending/ignoring in the file name of the new copy to help make it unique.
The tool will iterate through a single level of folders (not sub-subfolders) and for each one place a copy of the files into it.
| Bulk add files to existing Google Drive folders |
The following Google Apps Script is designed to go through an array of values that contains duplicates and create a new array of only the unique ones, arranged alphabetically. I needed this code when looping through files in a Google Drive folder where tutors and their groups formed part of the filename that I needed to extract for the end file that was created.
| Remove array duplicates |
The following Google Apps Script is designed to take a number of CSV files (structured in an identical way) stored in a Google Drive folder and combine them all into a single Google Sheet file. It maps the data within the CSV file to specific cells in the Google Sheet, along with creating a tab for each of the CSV files to separate them out.
This blog post is a development of my previous one on importing CSV data into (multiple) Google Sheet files.
| Bulk combine CSV files into a single Google Sheet |