Customizing Pages ’09: Using Keyboard Maestro to bypass Apple’s idiotic table shortcuts

Posted by Pierre Igot in: Pages
April 12th, 2010 • 11:32 am

One of the few things that truly drive me insane in Apple’s iWork applications is the keyboard shortcuts that they have chosen for the commands to insert additional rows or columns in a table.

When you are in a table in Pages ’09, for example, you can use option-Right to insert insert a new column after the column when your current selection is.

What is completely idiotic about these shortcuts is that they interfere with the existing and universal keyboard shortcuts for text navigation. In most Mac OS X applications (except Adobe’s applications, of course), including Pages ’09, option-Right is the shortcut for moving the cursor to the right by one word.

The problem is, of course, that, when you are inside a table cell and you are editing text, you might want to use option-Right to navigate the text inside the cell. And option-Right works as expected (i.e. to move the cursor to the right by one word) until… you reach the end of the text in the cell. When you reach the end, Pages ’09 stupidly starts interpreting option-Right as meaning “Insert a new column to the right.”

Text navigation being what it is, it is quite frequent that you have to press option-Right multiple times in quick success to jump over a number of words. And so if you overshoot by just one keystroke and hit option-Right one time too many, Pages ’09 starts adding new columns to your table, which is of course a royal pain and has to be undone.

The same problem applies to the other three shortcuts, i.e. option-Left, option-Up, and option-Down.

I’ve already written several times about this particular problem on this blog. The last time I wrote about it, it was to indicate a change in Pages ’09. In previous versions of Pages, the shortcuts for inserting additional columns and rows in tables were… option-shift-Right, option-shift-Left, option-shift-Up, and option-shift-Down.

They weren’t any better, of course, because they are also already-in-use keyboard shortcuts in Pages and in most other Mac OS X applications, this time for extending a text selection word by word.

So in Pages ’09, Apple changed the shortcuts, but the new ones are just as bad as the old ones.

I have also submitted multiple bug reports to Apple about this. The best response I have received so far is that these shortcuts seem to be chosen by a separate team, one that is responsible for all three iWork applications and not just Pages. As if that was an excuse.

And indeed the problem is just as bad in Numbers ’09. In fact, it’s even worse there, because the table function of the shortcuts overrides the text navigation function even when you are in the middle of a cell, editing text. This means that the text navigation shortcuts are effectively completely useless in Numbers ’09.

If I were the Apple engineers who have made this particular choice of shortcuts, I would be particularly ashamed. It is totally unacceptable that existing (and universal!) shortcuts for text navigation or selection are hijacked when editing text inside tables, whether it is in Pages ’09, Numbers ’09 or Keynote ’09.

But obviously these particular engineers are people who never use text navigation shortcuts themselves and do all their text navigation with the mouse. Good for them, I say. Now maybe someone should remind them that they work for every Mac user, and not just their own mouse-obsessed clique.

Anyway, until Apple’s engineers come to their senses and do the right thing, is there anything that can be done to alleviate the problem?

Until now, I thought that it was impossible. There is no way, of course, that you can redefine these basic, universal shortcuts in Pages ’09 or via System Preferences.

But… if you’ve been reading this blog in the past couple of weeks, you know that I am in a customizing mood, and that I have become an enthusiastic user of Keyboard Maestro. And well, it just so happens that, thanks to the powerful features of this program, there is something that can be done about this particular problem in iWork applications.

See, Keyboard Maestro is so powerful that it can keep a constant eye on what you are doing with your mouse or keyboard and intervene even without being invoked, simply when it recognizes something that you are doing or typing as a match for the trigger of one of its macros.

And yes, that even extends to something as fundamental as the keyboard shortcuts for text navigation, which do not even involve the Control or Command key.

So today I tried to see if I couldn’t come up with something clever for Pages ’09 that would force the application to ignore the “Insert Column” or “Insert Row” function of the text navigation shortcuts in table. And here is what I came up with:

Text Nav Bypass

It might not be particularly elegant, but it works. In a nutshell, what this macro does is that it intercepts the option-Right shortcut typed in Pages ’09 before the application itself has had a chance to process it. Then instead of instructing the user interface to do option-Right, which would of course trigger the problem in tables in Pages ’09, it instructs the user interface to do option-shift-Right, which, instead of moving the cursor to the right by one word, extends the selection to the right by one word, and then Right, which deselects the word that has just been selected, and puts the insertion point after that word.

And that, in effect, is the exact same thing as what option-Right would do.

Only now it gets done without using option-Right, and so Pages ’09 never hijacks the shortcut and never inserts a new column to the right of the current table cell. If you hit the end of the text in a cell and press option-Right once more, Pages ’09 just beeps to indicate it’s not happy (because shift-option-Right does not mean anything to the application in this situation) and then jumps to the next cell, because that’s what Right does in such a situation.

Granted, it is not ideal. Ideally, when the cursor reaches the end of the text in a cell, Pages ’09 should just stop, not move on to the next cell. But it’s better than having Pages ’09 insert new columns!

And you do see the selection highlighting flash by while Keyboard Maestro executes the actions in the macro. But, on my machine at least, it’s fast enough that I don’t really care, even if it also does this while I am navigating text outside a table.

I will have to see if this new way that the shortcut works affects my working habits in any other way when I am editing text outside table cells, but presumably it shouldn’t, because option-shift-Right + Right really is the equivalent of option-Right.

Of course, the same adjustment can be made for the other three text navigation shortcuts in Pages ’09. And the same bypassing behaviour can be implemented in Numbers ’09 as well.

It obviously means that you will no longer be able to usen the shortcuts in question for inserting new rows or new columns. But I don’t think that’s a problem, because there are other ways to insert rows and columns, and it’s a task that is far less common than text navigation, especially in Pages ’09—at least as far as I am concerned.

I also still hope that Apple’s engineers will finally come to their senses and change the shortcuts for inserting rows and columns to something that does not interfere with text navigation. (How about option-shift-command-Right etc.?) I don’t know what it will take to make them change this. I have exhausted all my options. But maybe if other users keep submitting bug reports about this, eventually they will get the message.

Until then, if you are like me and you cannot live without text navigation shortcuts and the iWork applications drive you insane in that particular department, Keyboard Maestro offers a solution.

Comments are closed.