Recently I’ve been getting more and more into mastering keyboard shortcuts and finding ways to avoid needing to use my trackpad. This has been something I’ve been slowly moving towards over the past several years as I started to realize how much faster I could get things done when using keyboard shortcuts. I’m pretty sure it began with using ⌘+T
and ⌘+W
while browsing in Chrome. After learning those simple commands, moving my cursor up to the tab bar seemed like it would take FoReVeR, and my perspective on how quickly I could navigate my computer totally shifted.
Since then, I’ve found a lot more shortcuts that have allowed me to fly through tasks on my computer with ease. They’ve enabled me to run through actions quickly and accurately, all while not having to move my hand over even once to use my trackpad. It might seem a bit ridiculous to complain about having to lift and move my hand 6 inches to the right, but when you’re constantly switching between the keyboard and pointer device, it gets to be tedious.
I was excited to learn about Shortcat after seeing Orta’s tweets about it: learning shortcuts for specific actions is pretty helpful, but being able to access nearly everything on my screen through the keyboard is a game changer.
This post isn’t really about Shortcat though – I could talk about how I’m using it and how it’s helped my workflow, but that’d be a short and boring post since I’ve only just started with it and I haven’t yet fully gotten used to it. No, this post is really about the issue I ran into trying to get the app running on my computer and getting around it.
Eager to start using Shortcat, I downloaded and installed the trial right after reading Orta’s tweet, and almost immediately ran into a roadblock. In order to work properly, Shortcat requires access as an assistive device work, but my company locked down all Security & Privacy
preferences for company-owned computers. It makes sense why they did this – assistive devices have the ability to control your computer, which obviously presents a major security issue if a malicious app is given permissions as an assistive device.
Still, I was fairly confident that what I was trying to install wasn’t malicious, and really wanted to get it running. I had never changed preferences on my Mac without using the System Preferences interface before though, so I was convinced that I had come up against a real blocker. I wouldn’t be able to install Shortcat, I’d just have to suffer because of my company’s IT protocols. After complaining about this to a coworker, however, I learned that there was an alternative.
My coworker directed me to a blog post that detailed a way to grant assistive device access to whatever app I wanted. While the UI for System Preferences was locked down, the backing database where the settings were actually stored were accessible through the command line, so long as you can run sudo
, something I was fortunately able to do.
Part of the job of being a developer is finding the right tools to perform the job, and it’s pretty much assured that somewhere along the line you’re going to need sudo
to install one of them. So, instead of having developers make requests to the IT department every time they need a new tool, my company opted to just give us all sudo
rights. (I wonder why they think it necessary then to keep the other locks in place if they know that we’ve essentially been granted the ability to circumvent them if we care enough to figure out how, but I’m not all too eager to bring that up to them any time soon.)
So anyway, about getting Shortcat working: The accessibility settings that I needed changed are saved in a SQLite store, and it’s easily edited through the command line using tccutil.py
, a tool created by the above post’s author. To use tccutil
, all you really need to know is the bundle identifier for the app that you want to enable. This is almost trivial once you try to install the app and it asks for accessibility permissions because it will have already been added to the SQLite store and marked as “disabled”.
Using tccutil
we can get a list of all the apps that are in the store by running
sudo tccutil -l
and pick out the bundle identifier from the list. Generally, the bundle identifier for an app will be obviously related to the app’s name. For example, Shortcat’s bundle identifier is com.sproutcube.Shortcat
. Makes sense!
In the case where you’re using an app doesn’t have a logically named bundle identifier, you can still figure out what it is by looking at the app bundle’s contents (right click on the app in Finder and choose “Show Package Contents”), finding the Info.plist
file and looking up the value for the CFBundleIdentifier
key.
With the bundle identifier in hand, all you need to do is run
sudo tccutil -e app.bundle.identifier
to enable the app as an assistive device. For Shortcat, that’s
sudo tccutil -e com.sproutcube.Shortcat
And that’s it! Once I ran that, I was able to launch and use Shortcat on my work machine.
As I said earlier, I’ve only really been using Shortcat for a little while now and I haven’t gotten close to a level of proficiency where I’d feel okay with commenting on it. There’s still a long way to go before I feel comfortable using it to navigate the screen in the same way Orta has written about, but I realize that building skills in tools like these takes time.
Even just getting used to using regular keyboard shortcuts, or finding ways to use Xcode behaviors to improve my workflow (something I’ll talk about later) took a good amount of time to truly feel comfortable with, and even now I still find times where I get tripped up.
What I’m most happy with, though, is learning more about how I can manipulate my computer and get around annoying roadblocks with tools on the command line. As I get more familiar with things like writing to SQLite stores or using command line programs, my computer seems to be opening up more and more to me. It becomes less of a mysterious box of arcane rules and processes, and starts to transform into an comprehensible thing; a place that I can understand and have power over. Most days, this doesn’t really mean all that much; but on the days that count, it feels pretty great. I’ll be sharing other things like this when I come across them, as I’m sure that there is still quite a lot left to learn.