Automate your Calendar's Color Code
Simple tips that helped streamline my process, boost productivity, and reduce manual work. Whether you're a freelancer, fractional leader, or entrepreneur, read on.
Figuring out your process as a one-person business is crucial to creating the headspace that allows you to do the work that actually matters.
I ran a questionnaire with founders, CEOs, leaders, and entrepreneurs and found that most people struggle with finding the right technology stack for their process.
I’m also an instructor and mentor, so I’ve always been fond of sharing the knowledge and the lessons that took me months and multiple failed attempts to learn, and here’s my bid at helping you figure things out much quicker than I did.
As a Fractional CTO, Technology Advisor, hobbyist entrepreneur, and generalist, I often find my weekly calendar overwhelmed by 10 different contexts, clients, and projects.
On a good day, this is what my calendar would look like.
Now imagine the same calendar with overlapping events, sudden Calendly invites, and some urgent firefighting tasks that come up almost every other day.
So how did I make sense of everything and give my brain the ability to figure things out without having to constantly dive into every detail of every day?
Step #1 - Coded Event Names
I didn’t have the time to constantly change an event’s color, so I simply coded things (programming things) based on the project itself.
So If I have a meeting with Client 1, the calendar event would be named [C1] Meeting
.
If I want to block 2 hours for work on Project A, the calendar event would be named [PA] Focus
.
That good day’s calendar would now look something like this.
Notice the difference? At least for me, without having to dive into the actual task and remember what/who it’s about, simply by scanning the first couple of letters, I know what my day’s looking like and where my headspace needs to be, roughly.
Though it was a good step, it still wasn’t good enough for me. My brain started demanding an even easier way, without having to read anything at all. So I thought, okay, colors!
Step #2 - Coloring Events
Most brains prefer visuals and patterns, and I wanted to capitalize on that. Almost every project and client I’m working on has a unique brand, and with that brand, a unique color that, when detected, triggers my brain to remember the important contexts of that brand.
You know how you see green and your brain associates it with Starbucks or Upwork? You see red and think Netflix? It’s roughly the same thing. So I figured, why not color each event with respect to the client or project’s main color?
But that requires extra steps for every event, and those who know me know I prefer doing things in the most efficient way possible. What are my options?
Opting for a Calendar application or Chrome extension - but I hate vendor lock-in and I don’t easily press the “Allow Access” button to apps I don’t know.
DIY - I like scripting.
So I developed a script to automate my calendar events based on the unique code that prefixes every calendar event, and here’s how you can do it too.
Create a Google Script Project
Go to https://script.google.com
Create a new project and give it a name
I went for
Automations
Access the new project and click on the “+” icon next to “Files”
Select “Script”
Give the new file a name
I went for
CalendarColorCoding.gs
Paste the following code
function colorEvents() {
var today = new Date();
var nextWeek = new Date(today.getTime() + 7 * 24 * 60 * 60 * 1000);
var calendars = CalendarApp.getAllOwnedCalendars();
for (var i = 0; i < calendars.length; i++) {
var calendar = calendars[i];
var events = calendar.getEvents(today, nextWeek);
for (var j = 0; j < events.length; j++) {
var event = events[j];
var title = event.getTitle();
if (title.startsWith("[ABC]")) {
event.setColor(CalendarApp.EventColor.RED);
} else if (title.startsWith("[DEF]")) {
event.setColor(CalendarApp.EventColor.BLUE);
}
}
}
}
Save the script
Click on the clock icon to set up a trigger. Choose the
colorEvents
function to run, set the time to "Every minute", and save the trigger.
Note: Change the title.startsWith(“[ABC”])
to any prefix you’ve chosen for every project, and the event.setColor(CalendarApp.EventColor.RED)
to any color you’ve chosen for that project. Replicate those if-else statements for as many unique colors as you need.
Et voila - your events for the next month will be automatically colored based on that script.
Final Notes
Prefixing event names and tasks with a specific code has many benefits - for now, I only invested enough time to automatically color calendar events. But the benefits can reach analytics, figuring out how much time you’re spending on every project, and connecting all sorts of apps, files, etc., in the future.
I really hate signing up for yet another software that does things for me if I can customize something myself, without costing me too much time, and without forcing me to have an extra tab constantly open on my browser.
Was this helpful?
Do you have feedback? Text me or