Use Alfred to Search Drupal API Documentation

Quick tip on how I use Alfred to search Drupal API Documentation right from my desktop. Saves me tons of time and I love a solution that keeps my hands off of my mouse.

I’ve been using Alfred a great deal lately. Its a handy little productivity tool/app launcher for Mac OS X. Think LaunchBar but with a powerful free version. The interface is clean and minimal and the app itself just works; it’s fast and doesn’t require that you change your workflow much. I tried QuickSilver a long time ago and it felt like a huge shift for me…I quickly uninstalled. Anyhow, here’s a quick tip that Drupal devs might find useful.

Alfred lets you set up custom searches. So, just like you can search Google by using the “google” keyword before your search string, you can set up your own for just about any site that let’s you search. I’m on api.drupal.org all day long digging for the right function for whatever I’m working on, or just to see documentation on how something in Drupal works. So the ability to search the Drupal API quickly and right from my desktop would be awesome. Alfred gives you that power.

Here’s how to do it:

  1. Install Alfred (if you haven’t already)
  2. Open Alfred’s Preferences
  3. Choose the “Features” tab
  4. Choose “Custom Searches” in the left column and click the plus (+) sign
  5. Enter the following details:
    • Search URL: http://api.drupal.org/?q={query}
    • Display Text: Drupal API
    • Keyword: api (this can be whatever you want, but api works for me)
    • Be sure to choose “Encode query using UTF8”
  6. Click Save

Now to use your new custom search goodness, just enter “api” followed by your search terms in the Alfred search bar and press enter. If you’ve set everything up correctly, your default browser should open up and return the search results for your terms on api.drupal.org. Pretty slick, right?

Update: @jacine has a sweet, mulit-tiered setup, check it out here

Categories: