Awhile back I came up with a Windows hack to make Caps Lock search Google. I missed that ability on MacOS so I cobbled together a hack to do it. It's crazy how in every OS that big useless key under your left hand is so hard to use!
  1. Download my surl AppleScript and put it somewhere. It's a very simple script which opens the clipboard contents as an URL or Google search. (First ever AppleScript program, comments welcome!). This script should work however you can convince MacOS to run it.
  2. Install Alfred and buy the Powerpack. Alfred runs AppleScript with (almost) any hotkey. It seems silly to pay $20 for this feature alone, but Alfred's awesome for other reasons too. (Alternatives for MacOS hotkeys are welcome!)
  3. In Alfred, go to Features / Global Hotkeys and click the +. Add the hotkey of your choosing (but not CapsLock yet) and make the action be the surl AppleScript you downloaded earlier. Copy some text and press your hotkey: should open a browser window.
  4. CapsLock is special. Install PCKeyboardHack, reboot, then open PCKeyboardHack in System Preferences. Choose "Change Caps Lock" and bind it to a new key code: I chose 105, which is F13 or PrintScreen. You can use Key Codes to find another option. (Note that 110 won't work: Alfred doesn't support it.)
  5. Go back to Alfred. Edit your working Global Hotkey from step 3, changing the binding to your Caps Lock key. Voila!
  6. (Optional). Go to System Preferences / Keyboard / Modifier Keys and bind Caps Lock to "No Action" in MacOS. I'm not sure this is necessary.
Alfred is such a powerful generic search doodad that it may make more sense to make Caps Lock open Alfred instead. But I really like having one button access to open URLs and Google searches, so I haven't done that yet.
techgood
  2011-08-07 00:25 Z