Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ronross

macrumors newbie
Original poster
May 14, 2008
22
14
MO
Hello,

I hope I'm at the right forum for assistance to my question. If not, please feel free to redirect me to the correct discussion location.

I currently use Chrome as my web browser. Whenever I highlight and click "Search with Google", it opens Safari instead of staying within Chrome. I understand OSX is coded to do this, however I have been reading that automator can create a script to force searching with google to stay or open the Chrome browser.

If anyone can assist me on how to accomplish this, I would be eternally grateful. Please understand I have very little knowledge of how to use automator, but I can follow direction and am not afraid to try.

Thanks,
 
  • Like
Reactions: zehirin

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,171
15,691
California
I think what you need to do is go here in System Prefs and set Chrome as your default browser.

Screen Shot 2018-03-18 at 12.22.41 PM.png
 

ronross

macrumors newbie
Original poster
May 14, 2008
22
14
MO
There seems to be some disconnect here. I have Chrome as my default browser in System Preferences>General. That isn't the issue. The concern is when I have an app open and highlight a word within the app with my mouse. I then right click and a dialog box opens with the option to search with Google. If I highlight and click that, Safari opens a new window. That's the issue. I do not want Safari opening a new window. I don't want Safari to open at all. It appears that "Search with Google" is coded to open Safari.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,171
15,691
California
I see what you mean. I just changed that setting to Chrome and it has not effect of the right click behavior you mentioned when I just tested in TextEdit. Sorry I'm not more help.
 

flowrider

macrumors 604
Nov 23, 2012
7,244
2,967
Try opening Safari, go into Safari Preferences and choose Search. Under the Search Tab, choose another Search Engine other than Google. And deselect any boxes that are checked.

Lou
 

flowrider

macrumors 604
Nov 23, 2012
7,244
2,967
Hmm, I just tried this in both Firefox and Chrome and in both instances Safari did not open, and Google worked as intended in the Browser open at the time.

Lou
 
  • Like
Reactions: jbarley

jbarley

macrumors 601
Jul 1, 2006
4,023
1,893
Vancouver Island
Whenever I highlight and click "Search with Google", it opens Safari instead of staying within Chrome.

I just now tried this with FireFox,(my browser of choice) and it opens the selection in a new browser tab in FireFox.
Sorry I cannot test Chrome as I do not have it available.

MacPro 3,1 running High Sierra.
 

ronross

macrumors newbie
Original poster
May 14, 2008
22
14
MO
2.jpg
3.jpg
I just now tried this with FireFox,(my browser of choice) and it opens the selection in a new browser tab in FireFox.
Sorry I cannot test Chrome as I do not have it available.

MacPro 3,1 running High Sierra.


Try this: Open an email. Highlight any word (preferably a noun or verb - for simplicity). Right click and "Search with Google". Tell me if Google opens Safari and provides the Google search within Safari. That is what is happening to me. I would prefer to keep the "Search with Google" option inside of Chrome, but from everything i've read, it's hard coded within OSX.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,171
15,691
California
Hmm, I just tried this in both Firefox and Chrome and in both instances Safari did not open, and Google worked as intended in the Browser open at the time.

Lou

I just now tried this with FireFox,(my browser of choice) and it opens the selection in a new browser tab in FireFox.
Sorry I cannot test Chrome as I do not have it available.

MacPro 3,1 running High Sierra.

Try it in something other than a browser so it uses the macOS service and I think you will see the behavior OP describes. I tried in TextEdit and it opens Safari no matter what I set the default browser to.
 
  • Like
Reactions: BigMcGuire

BigMcGuire

Cancelled
Jan 10, 2012
9,832
14,027
Try it in something other than a browser so it uses the macOS service and I think you will see the behavior OP describes. I tried in TextEdit and it opens Safari no matter what I set the default browser to.

Yeah I've had this happen on a handful of areas - not easily replicated. Worse in Windows when you have Chrome set as default but it still insists on opening IE for specific things.
 
  • Like
Reactions: Weaselboy

ronross

macrumors newbie
Original poster
May 14, 2008
22
14
MO
Try it in something other than a browser so it uses the macOS service and I think you will see the behavior OP describes. I tried in TextEdit and it opens Safari no matter what I set the default browser to.

Exactly.

I was hoping someone would finally be able to understand the issue. Probably my fault for not clearly explaining it. Now, can we get a solution, or is this the way it's going to be?

Thanks.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,171
15,691
California
Now, can we get a solution
I've got it worked out using that Automator action at the site you linked.

Do this... open Automator and tell it you want to make a Service. Then in the left column drag Run Shell Script over to the right like in my screenshot. Now paste in the line below.

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

Do command-s to save and name it Search in Google or whatever you want. Quit Automator.

Go to System prefs General and set the default browser to Chrome. Now also in System Prefs go to the Keyboard pane and in Shortcuts > Services make sure your new Search in Google service is checked (mine was on its own).

Now test in TextEdit or whatever. Worked for me.
 

Attachments

  • Screen Shot 2018-03-19 at 7.22.08 AM.png
    Screen Shot 2018-03-19 at 7.22.08 AM.png
    500.3 KB · Views: 439
  • Screen Shot 2018-03-19 at 7.18.28 AM.png
    Screen Shot 2018-03-19 at 7.18.28 AM.png
    97.4 KB · Views: 457
  • Screen Shot 2018-03-19 at 7.18.17 AM.png
    Screen Shot 2018-03-19 at 7.18.17 AM.png
    711.3 KB · Views: 499

ronross

macrumors newbie
Original poster
May 14, 2008
22
14
MO
I've got it worked out using that Automator action at the site you linked.

Do this... open Automator and tell it you want to make a Service. Then in the left column drag Run Shell Script over to the right like in my screenshot. Now paste in the line below.

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

Do command-s to save and name it Search in Google or whatever you want. Quit Automator.

Go to System prefs General and set the default browser to Chrome. Now also in System Prefs go to the Keyboard pane and in Shortcuts > Services make sure your new Search in Google service is checked (mine was on its own).

Now test in TextEdit or whatever. Worked for me.

Unfortunately it didn't work.

I see the option to "Search in Google". I check marked it with no keyboard shortcut. Also, it was noted that "Search with Google" was also listed in services, which I unchecked assuming both would create a conflict. Needless to say, the entire process seems to not work outside of Chrome. In other words, if I search a word within the four corners of Chrome, it uses Google. If I search a word outside of Chrome, ie. text editor, email it forces Safari to open and search.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,171
15,691
California
Unfortunately it didn't work.

I see the option to "Search in Google". I check marked it with no keyboard shortcut. Also, it was noted that "Search with Google" was also listed in services, which I unchecked assuming both would create a conflict. Needless to say, the entire process seems to not work outside of Chrome. In other words, if I search a word within the four corners of Chrome, it uses Google. If I search a word outside of Chrome, ie. text editor, email it forces Safari to open and search.
You must be missing a step or something... I did this on High Sierra and it works exactly like you want it to.

Did you setup the Automator service step by step following my instructions? Did you change the default browser to Chrome?
 

MickG

macrumors member
Mar 14, 2006
33
5
Santa Barbara, CA
This thread is old, but I've been plagued by the exact same thing I can't find where to turn it off. Chrome is selected everywhere you can select it.

Anybody got a terminal command, or is the Automator script really working to solve this?

Much obliged if anyone has a solution! Thanks!
 

aespana

macrumors regular
Feb 21, 2020
123
104
Uninstalling Google Chrome with AppCleaner and install it again doesn't work?
 

SyfoDyas

macrumors newbie
Dec 28, 2020
12
10
Uninstalling Google Chrome with AppCleaner and install it again doesn't work?
Its not a Google Chrome issue, its an OSX issue. See above.

@Weaselboy Your workaround worked for me, cheers! The only thing I haven't been able to do, is remove the Apple "Search with Google" shortcut (see screenshot). I've unchecked this from System Preferences>Keyboard Shortcuts> Services but its still there.
 

Attachments

  • Screen Shot 2021-08-26 at 10.30.20.png
    Screen Shot 2021-08-26 at 10.30.20.png
    20.6 KB · Views: 95
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.