Transform your Google Calendar with these simple steps to automatic colour coding
22 May 2024
SHARE

One Percent Better
Join 45,000+ ambitious professionals looking to optimise performance (minus the burnout). 100% science-backed strategies, from an organisational psychologist.
Ready to level up? Enter your email and let’s get started.
I went for a walk with a tech nerd friend of mine last week. I was whinging to her about having to manually colour code my calendar (I am a big fan of colour blocking as it allows me to glance at my week and see where I am spending my time and energy). I figured that if there was a solution to this problem, she would know about it.
My friend replied by explaining there was a solution for Outlook (you can try this one) but didn’t know of anything for Google Calendar. She suggested I search for “rules Google Calendar colour coding automate”. So as a bit of Saturday morning fun, I hit up Google and ChatGPT.
It turns out, I’m not the only person who has pondered this solution. While it isn’t currently possible to solve the problem without some code, I am happy to share that with the help of my partner Neo Aplin (who used to be a programmer) and some useful blog posts, I managed to automate Google Calendar colour coding last Saturday.
And if you are a productivity geek like me, you might be interested in a step-by-step guide of how to solve this problem.
Note - In an early version of my code, I managed to accidentally colour code ALL my team mates’ calendars too (oops - but don’t worry, this is now been fixed!!). However, it prompted me to think: we should ALL use the same colour coding system to make it easy to see how our fellow team members’ weeks are looking too.
(I realise that if you are an Outlook user, you’ve probably lost interest, in which case, consider sharing this post with Google ecosystem friends who care about productivity).
How to automate colour coding events in Google Calendar
Click ‘New Project’
Paste in this script
Customise it to your calendar by going to line 13 and replacing the placeholder text (insert your calendar name here) with your Calendar’s name - but keep the “speech marks”. Your calendar name is possibly your email address (mine was).
For further customisation, hop to the last part of this post “How to customise the code for your events”. And also - watch this Loom video I made explaining some of the customisation parts.
Save the project (click on the Save icon in the menu bar). I used “Colour Events”.
Click the ‘Play’ button to execute the script (and make sure there are no bugs).
A dialog box will open to ask for additional permissions. Allow access to your calendar.
In the left side menu, click “My Triggers”, the clock icon.
Click “Add trigger”.
Select “Colour Events” in the list of functions to trigger.
Change the type to “Minutes” and select “15 minutes”.
Save the trigger. This will run the script, and colour code any new events added to your calendar, every 15 minutes.
Finally, go into the Script to customise it to your own colour coding system using the suggestions below.
How to customise the code for your events:
You will see in the code that I have specified several categories of events that I wanted to colour code. Here is the text that the code looks for (search criteria) and it’s accompanying colour label.
“TRAVEL” = Pale red
MEETINGS:
“EXT” (external, virtual meetings) = Yellow
“EXTT” / “MEETING” / “COFFEE” (external, face-to-face meetings) = Orange
INT (meetings with team members) = Cyan
DELIVERIES:
DLV / KEYNOTE (keynote speaking and other client work) = Green
PODCAST / INTERVIEW (podcast interview, media interviews) = Blue
For YOUR code, replace my labels with ones that work for you. Just note this exact text (e.g. EXT) needs to go in the title of your event for the code to “see” it and colour code it accordingly. Also, make sure you use CAPITAL LETTERS for the code.
And if you want to delete any of my criteria, just delete it in sections, like below:
if (title.toUpperCase().includes("INT ")) {
e.setColor(CalendarApp.EventColor.CYAN);
}
Let me know in the comments how you go, and please do share this with anyone who you think could benefit from how I spent my Saturday :)

Cheers

DR AMANTHA IMBER IS AN ORGANISATIONAL PSYCHOLOGIST AND FOUNDER OF BEHAVIOURAL SCIENCE CONSULTANCY INVENTIUM.
One Percent Better
Join 45,000+ ambitious professionals looking to optimise performance (minus the burnout). 100% science-backed strategies, from an organisational psychologist.

How I Work Podcast
Listen now on your favourite platform


