Skip to main content
A cartoon depiction of the author, wearing a hoodie and smiling motd.co

lucky.rb

I really like making custom Services in Snow Leopard, and I’ve been looking for excuses to practice working with Ruby, so I created lucky.rb. When combined with Automator + Services, I can highlight text anywhere in OS X and press a keyboard shortcut to query Google with that text and replace it with a link to the top hit. This can come in handy when writing blog posts, commenting, chatting on IRC, etc.

Note that to use this you’ll need a Google API key. For more about setting up the script itself, check out its Github page. To make it a Service in Snow Leopard, open Automator and select “Service” from the startup screen. Then set up something similar to what you see below.

Automator notes:

lucky.rb notes: