Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Scenario: working away in Terminal, get an error message. Want to google it so I select text and use right-click and "Search with Google". Opens Safari every time. Google Chrome is my default browser. I've restarted the machine twice since I confirmed that.

share|improve this question

1 Answer 1

up vote 12 down vote accepted

Search with Google is a service provided by Safari and has nothing to do with Terminal.

Google Chrome should provide its own service for this feature. It doesn't.


Or you can write your own, e.g. using Automator and AppleScript:

Open Automator and select to create a new Service. At the top, select text and any application. Then, add a Run Shell Script action from the library to the workflow by drag&drop or double-clicking. Change its input to as arguments, and paste the following script in its main text area:

#!/bin/bash
function urlencode {
    echo -n "$@" | perl -MURI::Escape -ne 'print uri_escape($_)'
}
open "http://google.com/search?q=$( urlencode "$@" )"

Automator screenshot

This will open the URL http://google.com/search?q= followed by your URL-escaped text selection in your default browser.

Save as Search with Google in Default Browser and try again.

share|improve this answer
    
1. How do i get this service to appear in the main contextual menu, like Safari's does? –  aaronbauman Sep 29 at 19:09
    
2. How can I get rid of Safari's service in the contextual menu? –  aaronbauman Sep 29 at 19:10
1  
@aaronbauman Disable it in System Preferences » Keyboard » Shortcuts » Services. This will remove it also from the Services submenu in the application menu though, and disables its keyboard shortcut, if set. –  Daniel Beck Sep 29 at 19:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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