I use Google Mail’s web interface for both personal ramblings with friends, and during my endless conversations with my buddies at work. This usually works just fine - the Google interface designers and engineers have produced a solid and well-designed interface for people dealing with large amounts of mail on a daily basis.

So, all is good then? No. Pose that I’ve got a web browser (in this case, Safari) open, with two tabs displaying my personal and my job’s mail interfaces respectively (both are hosted by Google). If some operation in tab one takes more time than usual to complete (I’ve bet you’ve seen this - it’s indicated with a small yellow overlay at the top of the page telling you about the progress of the operation) I usually switch over to the other tab (or any other tab, it doesn’t have to be another Google Mail interface in that newly switched to tab). So far so good.

When interacting with web pages, you often use your keyboard (to fill out forms, write comments etc.). This works just fine until the first tab decides that it is done loading - and makes Safari put focus on the first tab again. This is NOT OK. I could be in the middle of a typing operation, and once the first tab gains focus again each and every keystroke I type is sent to that tab. This could lead to all kind of “interesting” things - before realizing what has just happened, I usually manage to mute, archive and step through some mails… argh!

I’ve tried to reproduce the behavior in Firefox (version 3) without any success. Might just be Safari that’s playing tricks with me. Just wanted to let you know, and flag for help (if you know how to fix this, I’m more than eager to learn how to prevent this).

Do you find yourself switching between different languages several times a day? I myself switch between English and Swedish on daily basis, when writing mails, coding etc. Since I use OS X, I try to use the built in dictionary so that I avoid misspellings.

So, how do you go about to change the dictionary currently in use? Simply invoke the Edit menu item, and then find Spelling and Grammar. In its submenu, invoke Show Spelling and Grammar (for those of you who prefer to use the keyboard, just press Cmd + :). A floating window appears, but note that it does not have focus. Neither can you give it focus by invoking Expose, or by flipping through the active application’s windows. Your only choice left… the mouse?

No, you can actually perform one more nifty trick with your keyboard. In System Preferences, under Keyboard & Mouse you’ll find Keyboard Shorcuts. In there, look for Move focus to the floating window. By default, it has a keyboard shortcut of Ctrl + F6. Try invoking it and you’ll se that the current application’s floating window will gain focus.

So, to switch the current language used by the dictionary:

  • Open up Spelling and Grammar by pressing Cmd + :
  • Give it focus by pressing Ctrl + F6
  • Tab around in the window to change the parameters you like
Since the above method is time consuming I thought I’d write a simple AppleScript that does all those things for me. But… it seems I’m not competent enough to figure out how to find floating windows using System Events - is it even possible? If you have some spare time, write me such a script and you’ll make my day. Now go play with those keyboard shortcuts!