37
33
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
You can also remove the stock one by finding if accord to the instructions at http://osxdaily.com/2013/05/14/remove-services-contextual-menu-mac-os-x/
– Joel Mellon – 2014-08-26T22:33:57.853@slhck - how do I add quotes around the search string (e.g. search for "hello world" rather than hello world)? I have tried to add " in several locations in this command but I only end up with one " in the search string, either in the beginning or at the end. – d-b – 2017-04-08T00:12:00.307
@d-b Can't confirm, it works for me when I add double quotes. – slhck – 2017-04-08T07:33:52.417
@slhck Where do you add the double quotes? Can you post your oneliner? – d-b – 2017-04-08T09:15:55.240
@d-b I just run
open "http://www.google.com/search?q=$(ruby -rcgi -e 'print CGI.escape $<.read.chomp')", then enter"Hello World", then pressCtrl-D.https://www.google.com/search?q="Hello+World"opens. – slhck – 2017-04-08T10:00:29.570@slhck Aah, but that requires that the search phrase contains double quotes in itself. I want to select a couple of words that is not quoted (company names in fact) and search for them at Google within quotes. Sorry for the misunderstanding. – d-b – 2017-04-08T12:10:38.247
More screenshots of how to create and connect the service http://stackoverflow.com/questions/17935301/how-to-force-mac-os-to-open-search-with-google-in-chrome
– Jason Harrison – 2017-04-27T17:26:04.393Lri, this is great; it works! Now, would you care to explain how approximately it works? It invokes
bash, then ... what doesruby -e 'require "cgi"; print CGI.escape($<.read.chomp)'do? I presume this returns back to Chrome? – Blaz – 2011-12-21T09:49:01.6206
@courteous The
– slhck – 2011-12-21T14:17:14.093rubycommand 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, thank you for the clarification. I'd up-vote if only I could. – Blaz – 2011-12-24T19:21:45.253
2
@Lri THANKS FOR THAT! If somebody would like to have easy google translator access under right mouse button on OS X https://gist.github.com/andilab/7219174
– andilabs – 2013-11-08T11:12:22.407