69

While using Mac OS, its very useful to use "Search with Google" tool in context menu to directly search selected text from error windows or other content:


enter image description here


But problem is, that it always open Safari by default. I have Google Chrome as default browser, but it makes no sense.

Does anyone know how to force this option open in Google Chrome instead of Safari?

2

2 Answers 2

65

The OP is not using the context menu in Chrome, and does not have the "Search Google for...." option.

The "Search with Google" entry is provided by Safari and won't work with another browser to my knowledge.

The closest thing that I found in my journey to provide the same desire was to create a service of your own using Automator.

Instructions:

  1. Open Automator and choose Service as the type
  2. Add a "Run Shell Script" action by dragging it to the right pane enter image description here
  3. Add script

    open "http://www.google.com/search?q=$(ruby -rcgi -e 'print CGI.escape $<.read.chomp')"

    Adjust the TLD as needed for your country specific Google page. ex: http://www.google.co.in/search?q=

  4. Save the service as "Search Google"

  5. Activate the service in System Preferences and optionally assign a keyboard shortcut. Once activated, "Search Google" will appear in the context menu enter image description here
9
  • 2
    Thanks. I had to replace .com with my country specific co.in for Google address, otherwise it was opening only a blank google search page. Jul 19, 2016 at 15:50
  • 1
    Thanks @YogeshUmeshVaity, good point. I've updated with a note for future visitors.
    – Casper
    Jul 20, 2016 at 16:54
  • 5
    "Services" are now called "Quick Actions" in Automator. I'm not sure why, but this has trouble with pdfs in Preview. I expect something needs to be done with the text format? May 6, 2020 at 21:32
  • 2
    My problem is that while this adds an entry underneath the "services" menu, I still have the preconfigured "search with Google" that opens Safari at the top level. This is true even if the preconfigured one is unchecked in Preference. So,I still sometimes choose this by mistake (which appears to trigger a crash while sleeping). Any idea how to remove the unwanted preconfigured menu entry?
    – Jice
    Aug 23, 2020 at 5:14
  • 2
    @Youthoverturn if you are referring to the Preferences->Keyboard->Shortcuts->Services->Searching->"Search With Google", I do have that unchecked. However, still shows up in the Mail services menu. Do you mean something else?
    – Jice
    Nov 9, 2020 at 4:31
2

Be sure to choose "Search Google for..." near the top of the list in the right-click dialog box. If you choose "Search with Google" (near the bottom) it's still going to open Safari.

1
  • 6
    This is the wrong answer (see explanation below in answer from Casper)
    – jakob.j
    May 23, 2016 at 17:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.