Navigating Mathematica with Keyboard Maestro

If you think I’ve written too much about Mathematica recently, don’t worry. This post discusses something in Mathematica that annoys me, but it isn’t really about Mathematica. It’s about how I eliminated that annoyance with Keyboard Maestro and how I should have done so long ago.

What I hate about Mathematica is navigating in its help window. Like Safari, the Mathematica help window has backward and forward navigation arrows up near the top left,

Mathematica documentation window

but unlike Safari, it doesn’t use the standard keyboard shortcuts of ⌘[ and ⌘] to navigate. Wolfram’s documentation says you can use “Alt ←” and “Alt →” to navigate, but those don’t work.1 If there’s a cursor blinking somewhere in the window, ⌥← and ⌥→ move the cursor left and right, which is standard Mac cursor control. If there’s no active cursor in the help window, ⌥← and ⌥→ do nothing.

And even if Mathematica worked the way its documentation says it works, and it overrode the standard behavior of ⌥← and ⌥→, I would never use them for navigation because my fingers don’t think that way. They want to use ⌘[ and ⌘] because that’s what Safari has trained them to use (also Firefox and Chrome).

Recently, during a particularly intense session with Mathematica’s help system, I got angry with myself. Why did I keep hitting ⌘[ and ⌘] and getting angry with Mathematica? Yes, Wolfram should adhere to Mac conventions, but you’re not powerless. Stop getting angry and fix the problem!

So I opened Keyboard Maestro and had a pair of one-step macros written in a few minutes. Here’s Help Back,

KM Help Back

and here’s Help Forward,

KM Help Forward

They’re saved in Keyboard Maestro’s Wolfram group, which means they work only when Mathematica is the active application.2

Initially, I tried to use Keyboard Maestro’s Click at Found Image action, but that didn’t work consistently. Apparently, Mathematica’s arrow buttons are too anemic for Keyboard Maestro to find reliably. So I switched to Move or Click Mouse and all was right with the world.

I should mention that the coordinates of the click with respect to the upper left corner of the window were determined with the help of the Get button. Click it and you have a five-second countdown (with beeps) to bring the appropriate window to the front and position the mouse where you want the click to happen. The coordinates fill in automatically. It’s one of those features that users love about Keyboard Maestro.

Now when my fingers press ⌘[ and ⌘], Mathematica’s help window responds the way it should, and I don’t get angry anymore. Except a little bit at myself for not doing this ages ago.


  1. Normally, this is where I’d complain that Macs don’t have Alt keys, they have Option keys, but I’m going to let that pass. See how I’m letting that pass? 

  2. Wolfram has really messed up its naming. The documentation calls the app either “Mathematica” or “Wolfram Mathematica,” depending on what part of the documentation you’re looking at. My account says I have a license for “Wolfram Mathematica.” The app’s icon and the menu bar when the app is running say it’s “Wolfram.” Keyboard Maestro goes with the name in the menu bar.