Mac OS X (Lion) Chrome: shortcut for "Search With Google"

The Search With Google service is provided by Safari, and it is not meant to work with other browsers.

You can create another service yourself though:

  1. Open Automator and choose the Service template
  2. Add a Run Shell Script action for a script like open "http://www.google.com/search?q=$(ruby -rcgi -e 'print CGI.escape $<.read.chomp')"
  3. Save the service and assign it a shortcut from System Preferences


Nowadays you can also use "Run Javascript" in automator services, and stack it with "Internet" → "Open webpages". Something like this:

JavaScript to run:

function run(input, parameters) {
   return "https://www.google.com/search?q=" + encodeURI(input)
}

Screenshot of Automator "service":
screenshot of Automator "service"


Just wanted to add that if you use accepted answer and save the service as "Search with Google", it will be executed instead of the service of the same name that launches Safari.