It happened again..
I opened Chrome, clicked a bookmark I was pretty sure was right, and landed on someone else's Leetcode dashboard. Not a stranger's but my own, just the wrong me. The wrong email, the wrong profile, the wrong version of my life that Chrome has helpfully partitioned off into its own little universe.
I have at least 7 Chrome profiles. I know. I know. Don't ask me why.
The thing is, it didn't start this way. It never does. You make one extra profile for work. Then one for a side project. Then one because you wanted to keep your personal Google account separate. Then somehow, four profiles later, you genuinely cannot remember which email you used to sign up for Spotify, and you're too scared to check because what if it's the one attached to an email address you no longer use.
This is not a hypothetical. This was my actual life.
So naturally, I did what any reasonable person does. I looked for an existing solution.
The part where existing tools almost helped
Chrome's built-in profile switcher is actually decent. And there are extensions for this exact problem, some of them genuinely well-built. I tried a few.
The issue? Almost every solution assumed I wanted to manage my profiles better. Clean them up. Organise them. Switch between them more smoothly.
That's a fine problem to solve. It's just not my problem.
My problem was more specific and, honestly, more embarrassing: I didn't want to think about profiles at all. I wanted to click one thing and arrive at the right place — right profile, right site, already logged in, all without making a single decision.
The extensions were handing me a better map. I needed a teleporter.
So I built one. Sort of.
It started as a small experiment on a slow afternoon. Turns out Chrome can be launched from the terminal with flags — you can pass it a specific profile directory and a URL, and it opens exactly there. So I wrote a small bash script that does all the thinking for me.
Here's the whole thing:
bash#!/bin/bash
email=$1
url=$2
# Profile mapping using if-elif
if [ "$email" = "email001@gmail.com" ]; then
profile_dir="Profile 1"
elif [ "$email" = "email002@gmail.com" ]; then
profile_dir="Profile 2"
elif [ "$email" = "demail003@gmail.com" ]; then
profile_dir="Profile 3"
elif [ "$email" = "email004@gmail.com" ]; then
profile_dir="Profile 4"
elif [ "$email" = "email005@gmail.com" ]; then
profile_dir="Default"
else
echo "Email not found in profile mapping: $email"
exit 1
fi
open -na "Google Chrome" --args --profile-directory="$profile_dir" "$url"
That's it. You pass it two arguments — an email and a URL — and it figures out which Chrome profile maps to that email, then launches Chrome directly into that profile at that URL. No switching, no thinking, no wrong account.
To use it, you'd call it from terminal like this:
bash chrome-launcher.sh email001@gmail.com https://leetcode.com
Chrome opens. Right profile. Right site. You're already logged in.
The script runs entirely locally - no internet calls, no third-party anything, just your own machine doing what you told it.
The part that made it actually eased it — Apple Automator
A terminal command is useful. A clickable icon in your dock is delightful.
This is where Apple Automator comes in. If you're on a Mac and haven't used Automator, it's a built-in app that lets you wrap scripts and actions into standalone applications (no coding required on the Automator side).
Here's exactly how I set it up:
Open Automator (it's in your Applications folder)
Choose New Document → Application
Search for "Run Shell Script" in the actions panel and drag it into the workflow
In the shell script box, type your launch command — for example:
bash /path/to/chrome-launcher.sh email001@gmail.com https://leetcode.com
Hit File → Save, give it a name like LeetCode and save it as an Application
Drag that app to your Dock
That's one icon. One destination. You repeat this for every profile and site combo you care about — Spotify, your work dashboard, whatever, each saved as its own tiny Automator app, each hardcoded to the right email and URL.
I now have a small row of these in my dock. Each one is basically a teleporter to a specific corner of my digital life.
What actually changed?
This didn't change my life. It's a bash script and some Automator trickery. But it removed a specific, recurring friction that was annoying me multiple times a day.For someone whose memory works at the speed of a browser with 40 tabs open, that's actually significant.
Should you build this?
If you have more than two or three Chrome profiles and you've ever stared at a login screen thinking "wait, which email did I use here" — yeah, probably.
The whole setup takes maybe 20 minutes. The script is short enough that you can read and understand the entire thing in 30 seconds. The Automator part is point-and-click. And once it's done, you genuinely stop thinking about it — which is the whole point.
To set it up yourself, you just need to:
Know your Chrome profile directories (you can find them at chrome://version/ under "Profile Path")
Map each email to its profile in the script
Create one Automator app per destination
I'm thinking of cleaning this up into a proper repo. If that sounds useful, let me know in the comments — helps me figure out whether this is a "me problem" or a very much "us problem."
My guess? Definitely an us problem.
Top comments (0)