Under Keyboard Shortcuts : Application Shortcuts I've already tried with either "Search With Google" or "Google Search..." as the Menu Item (both of these for Application set as Google Chrome, of course).

Also, even with Chrome as the default browser, the Search With Google (under Services : Searching; which works) always uses Safari.

In short, how do you set up a keyboard shortcut to avoid right-clicking the selected word and choosing Search Google for 'the selected word' from the right-click menu?

Thank you.

3 Answers 3


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

  • Lri, this is great; it works! Now, would you care to explain how approximately it works? It invokes bash, then ... what does ruby -e 'require "cgi"; print CGI.escape($<.read.chomp)' do? I presume this returns back to Chrome?
    – Blaz
    Dec 21, 2011 at 9:49
  • 6
    @courteous The ruby command reads the string you searched for and URL-escapes it. The result of this is evaluated by $() and just appended to the Google.com line by bash.
    – slhck
    Dec 21, 2011 at 14:17
  • @slhck, thank you for the clarification. I'd up-vote if only I could.
    – Blaz
    Dec 24, 2011 at 19:21
  • 2
    @Lri THANKS FOR THAT! If somebody would like to have easy google translator access under right mouse button on OS X gist.github.com/andilab/7219174
    – andilabs
    Nov 8, 2013 at 11:12
  • 4
    You can also remove the stock one by finding if accord to the instructions at osxdaily.com/2013/05/14/… Aug 26, 2014 at 22:33

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"

  • These days (2018) this is by far the best answer.
    – noamtm
    Jan 25, 2018 at 8:10
  • 2
    On my mac, Automator's Service has been changed to 'Quick Action'. And 'Run JavaScript' is under 'Utilities' on the left panel.
    – AnT
    Aug 1, 2022 at 3:45
  • "There was a problem with the input to the service" in Preview.app stackoverflow.com/questions/64127041/… works in other apps
    – andilabs
    Jan 7, 2023 at 1:24

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.

  • 2
    That added a second "Search with Google" command to the context menu until I unchecked the one in Preferences - Keyboard - Services - Searching.
    – Jerry101
    Jul 27, 2018 at 0:09
  • As of macOS Monterey 12.5.1, the name has changed to "Search With Google" (note the capital W). If you spell it this way, then @drstrangepork's suggestion works. Sep 6, 2022 at 18:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .