One of the things that has been showing up in my feeds for years was the recommendation to use a keyboard launcher. Every now and then I tried one, but got rid of it after a few days. Too complex, too developer-y, too couldn’t-see-the-benefit (crazy, I know). This changed when I met Alfred, which (who?) does so much that I can’t even begin to tell you, and at the same time integrates seamlessly into the way I use my Mac. Let me spell it out for you: I love it. And the base version is free, though I recommend getting the powerpack for a special pre-1.0-release price, because this is where the real fun begins. It’s even on the Mac App Store. There, I just eradicated your last excuse to not get it immediately.
Anyway, Alfred recently became even more capable with the introduction of extensions (available to powerpack users – told ya to get it!), which marks the departure from Alfred as an app to Alfred as a platform. With extensions users can perform actions or run scripts.
With the help of some people who actually know a thing or two about AppleScript I managed to write (make/create/copy together?) my first extension for Alfred: “Send URL to Chrome”. What this does is send the URL of the website that is currently open in Safari to Chrome. As you may have noticed after upgrading to Lion is that it comes without Flash, and some people, including John Gruber himself recommend you try to live without it. I surely do. But at times you do need it, and since Chrome comes bundled with Flash all by itself you can now use this Alfred extension to view this bad bad site – that wants you to install a plug-in you don’t want to install – in Chrome in perfectly good shape. Just fire up Alfred, start typing your personal keyword, and there you are.
Note: For this to work properly it’s best to have Chrome running. You don’t necessarily need to have a window open, though this might cause problems with Lion’s Automatic Termination functionality. Also I want to make clear that I know nothing about AppleScript and have only copied this together from mentioned places on the web. Alas, I’d like to take credit for making it work without Chrome having an open window. If for some strange reason you don’t want to use Alfred and just want the AppleScript, here you go:
property theURL : “”
tell application “Safari”
set theURL to URL of current tab of window 1
tell application “Google Chrome”
if (count of windows) is 0
make new window
make new tab at end of tabs of front window
set URL of active tab of front window to theURL