Toggle Twitter

I use Twitter. A lot, and almost entirely on my Mac desktop. Over the years, I have switched between many popular client applications, often returning to old favorites when the specific advantages of one outweighs the advantages of another for my current priorities.

The way I use Twitter is to leave one of these client applications running in the background, with all the notification settings set to off. I still check it quite often, but it’s on my terms. If I get deep into concentration working on some bug, chatting with a friend, or or watching a video, I don’t want Twitter interrupting me.

Twitterrific was the first desktop client I used, and I can’t remember whether it was the default choice or if I picked it, but I got in the habit of using the global keyboard shortcut Cmd-Ctrl-T to toggle the window’s visibility. When I tried other Twitter apps, I made a point of setting the preference in that app to match the same shortcut.

Eventually I tried an app that didn’t support a setting for a global keyboard shortcut, so I had to write a script to do it for me. It occurred to me at some point that I could write a single AppleScript to handle the toggling of visibility regardless of which app I was using.

Download “Toggle Twitter”

The script logic is pretty simple: given a list of common Twitter app-names, is one of them running? If so, toggle it. If not, launch it. If you’re using something else, just add it to the list, and it should work perfectly.

I used FastScripts to hook this up to the global shortcut Cmd-Ctrl-T because it matches my historic muscle memory, and well, T is for Twitter.