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 11 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

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.