Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average. Display Modes
Old 05-25-2010, 03:27 PM   #1
petpirepete
Prospect
 
Join Date: Nov 2008
Posts: 12
Question Modify "Search With Google" Service to use another browser???

I'm looking for this for a long time. I want to be able to use the "Search With Google" Service with other browsers than Safari.

I don't know if it's even possible and didn't find any information about that on the internet.

I hope someone here will be able to help!

I am using:
Powerbook G4 1.67
10.5.8
I want to use Firefox to search Google

Thanks
petpirepete is offline   Reply With Quote
Old 05-25-2010, 04:04 PM   #2
DeltaMac
League Commissioner
 
Join Date: Jan 2002
Posts: 8,526
Just to clarify - you want the OS X Services menu "search with Google" to use a non-Apple browser, instead of Apple's Safari?

Why not just use the search menubar window in FireFox? That also allows you to choose on-the-fly from several different search engines. Why restrict yourself to just Google?
DeltaMac is offline   Reply With Quote
Old 05-26-2010, 10:36 AM   #3
petpirepete
Prospect
 
Join Date: Nov 2008
Posts: 12
Quote:
Originally Posted by DeltaMac
Just to clarify - you want the OS X Services menu "search with Google" to use a non-Apple browser, instead of Apple's Safari?

Yes

Quote:
Originally Posted by DeltaMac
Why not just use the search menubar window in FireFox? That also allows you to choose on-the-fly from several different search engines. Why restrict yourself to just Google?

In fact, it's about the right clic menu search with google that we can use in many apps (TextEdit, Mail...). Each time you use it it open Safari instead of using your default browser.

I wanted to be able to change the default browser for this feature because it's a cool feature that can boost your productivity. It's a lot faster to right clic than to:
- select - copy - open browser - paste - clic search button/press enter -
petpirepete is offline   Reply With Quote
Old 05-26-2010, 11:24 AM   #4
tw
Hall of Famer
 
Join Date: Apr 2007
Posts: 4,262
technically speaking, that's not a 'service' but rather a contextual menu item (services are in the 'services' submenu). My guess would be that it just runs an 'open' command in unix, so that the webpage will open in whatever your default browser is; try setting your default browser to firefox and see if that works. If not, you can easily create a new (actual) service that will search for selected text in google in whatever browser you prefer.
__________________
Philosophy is a battle against the bewitchment of our intelligence by means of language. -LW-
tw is offline   Reply With Quote
Old 05-26-2010, 12:09 PM   #5
petpirepete
Prospect
 
Join Date: Nov 2008
Posts: 12
Thanks for the info!

I said service because it is in the services menu: "search with Google : command-shift-L" and regardless the default browser it will open with Safari.

Last edited by petpirepete; 05-26-2010 at 12:12 PM.
petpirepete is offline   Reply With Quote
Old 05-26-2010, 01:18 PM   #6
mclbruce
Hall of Famer
 
Join Date: Mar 2002
Posts: 3,878
I'm seeing the problem as well. If I use "Search with Google" in TextEdit, or iCal, it opens Safari. If I use it in Firefox, my default browser, I get the result in Firefox.

I don't know how to fix the problem. Perhaps you could use Automator to make a new service or contextual menu item that works with a different browser or the default browser.
mclbruce is offline   Reply With Quote
Old 05-26-2010, 02:23 PM   #7
petpirepete
Prospect
 
Join Date: Nov 2008
Posts: 12
I know I could use an appple script and the app "ThisService" to add the script to the services menu but unfortunately I'm really bad with apple script...
petpirepete is offline   Reply With Quote
Old 05-26-2010, 02:29 PM   #8
petpirepete
Prospect
 
Join Date: Nov 2008
Posts: 12
I tried this without success

Code:
#This script searches Google.com for the contents of text in the clipboard.

set url1 to "http://www.google.ca/search?q="

tell application "System Events"
	
	set myquery to the clipboard
	
end tell

-- changes space to plus using function at end of file

set thequery to SaR(myquery, " ", "+")

tell application "Firefox"
	
	activate
	
	tell application "System Events"
		
		tell process "Firefox"
			
			click menu item "New tab" of menu "File" of menu bar 1
			
		end tell
		
	end tell
	
	set theURL to url1 & thequery
petpirepete is offline   Reply With Quote
Old 05-26-2010, 02:56 PM   #9
tw
Hall of Famer
 
Join Date: Apr 2007
Posts: 4,262
ok, here's how you do it. Open Automator, select Service from the popup that appears. At the top of the window, make sure it says "Service receives selected text in any application", and that the 'replaces text' checkbox is off. now add the action Run Shell Script (you can find that in the 'Utilities' section). Leave the shell as /bin/bash, set the 'pass input' pulldown menu to say as arguments, delete the default for-loop text that appears, and enter open -a FireFox "http://www.google.ca/search?q=$1" into the text area. save the service3 with whatever name you like. This service will use Firefox to search for selected text in google. if you want to use a different browser, replace -a FireFox with whatever (-a Camino, -a Opera, -a SeaMonkey). If you want to choose a browser at run time that will take an extra action - ask if you can't figure it out.
__________________
Philosophy is a battle against the bewitchment of our intelligence by means of language. -LW-
tw is offline   Reply With Quote
Old 05-26-2010, 04:23 PM   #10
petpirepete
Prospect
 
Join Date: Nov 2008
Posts: 12
Automator's services are for snow leopard only

Powerbook
10.5.8
petpirepete is offline   Reply With Quote
Old 05-26-2010, 08:13 PM   #11
tw
Hall of Famer
 
Join Date: Apr 2007
Posts: 4,262
Quote:
Originally Posted by petpirepete
Automator's services are for snow leopard only

Powerbook
10.5.8

then you'll need to use On My Command (or similar) and adapt the above script. I don't have a 10.5 machine to test on, though, so not much I can do to help.
__________________
Philosophy is a battle against the bewitchment of our intelligence by means of language. -LW-
tw is offline   Reply With Quote
Old 05-26-2010, 08:36 PM   #12
petpirepete
Prospect
 
Join Date: Nov 2008
Posts: 12
If I achieve something I'll let you know!
petpirepete is offline   Reply With Quote
Old 05-27-2010, 05:49 PM   #13
petpirepete
Prospect
 
Join Date: Nov 2008
Posts: 12
Here's how I did it:

Download and Install OnMyCommand/OMCEdit
Open OMCEdit
Click on "Download Commands" then "Download"
Go in "Command Library"
Choose #22 and click on "Append to Command"
Change the name if you want (in "Command Name")
Write " Top Level " in location if you don't want a sub-menu, or choose a name for the sub-menu ("In On My Command" is the default)
Save
and you're done!
petpirepete is offline   Reply With Quote
Old 05-27-2010, 06:40 PM   #14
petpirepete
Prospect
 
Join Date: Nov 2008
Posts: 12
Here's 2 commands for Google Translate:

From any language to French:

open "http://translate.google.fr/translate_t?hl=&ie=UTF-8&text="__OBJ_TEXT__"&sl=auto&tl=fr#"


From any language to English:

open "http://translate.google.fr/translate_t?hl=&ie=UTF-8&text="__OBJ_TEXT__"&sl=auto&tl=en#"

Last edited by petpirepete; 05-27-2010 at 11:27 PM.
petpirepete is offline   Reply With Quote
Old 05-27-2010, 09:50 PM   #15
petpirepete
Prospect
 
Join Date: Nov 2008
Posts: 12
HINT: Add a Search Google that use your default browser to the contextual menu

Thanks for those who helped in my previous thread!

I was looking for this for a long time. In OS X, there's a cool feature that let you search in google from the contextual menu in a lot of apps (Mail, TextEdit, iCal...) but this features use Safari instead of your default browser (Firefox). I wanted to be able to do the same with my default browser, here's how I've done it:



Download and Install OnMyCommand/OMCEdit
Open OMCEdit
Click on "Download Commands" then "Download"
Go in "Command Library"
Choose #22 and click on "Append to Command"
Change the name if you want (in "Command Name")
Write " Top Level " in location if you don't want a sub-menu, or choose a name for the sub-menu ("In On My Command" is the default)
Save
You're done!

This tool let you add a lot of useful things to your contextual menu. Here's two more commands I made to be able to translate(Google Translate):

From any language to French:

open "http://translate.google.fr/translate_t?hl=&ie=UTF-8&text="__OBJ_TEXT__"&sl=auto&tl=fr#"


From any language to English:

open "http://translate.google.fr/translate_t?hl=&ie=UTF-8&text="__OBJ_TEXT__"&sl=auto&tl=en#"

You just need to make a new command (in OMCEdit), add the command in the command field and name it. Those can easily be change to fit the language of your choice. If you want to use a specific browser instead of your default add "-a YourBrowserName" without the quotes before the command.

Exemple:
open -a FireFox "http://translate.google.fr/translate_t?hl=&ie=UTF-8&text="__OBJ_TEXT__"&sl=auto&tl=en#"

I hope you'll enjoy!

I am using this with Leopard but it should work in Snow Leopard as well.

Hugo
petpirepete is offline   Reply With Quote
Old 05-28-2010, 09:26 AM   #16
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,464
petpirepete:
I merged your new thread in with this one.
Note that the forums are help forums - they are not for posting hints. The place for that is the main macosxhints site.
__________________
hayne.net/macosx.html
hayne is offline   Reply With Quote
Old 02-09-2011, 11:27 AM   #17
spoow
Prospect
 
Join Date: Feb 2011
Posts: 7
Quote:
Originally Posted by tw
ok, here's how you do it. Open Automator, select Service from the popup that appears. At the top of the window, make sure it says "Service receives selected text in any application", and that the 'replaces text' checkbox is off. now add the action Run Shell Script (you can find that in the 'Utilities' section). Leave the shell as /bin/bash, set the 'pass input' pulldown menu to say as arguments, delete the default for-loop text that appears, and enter open -a FireFox "http://www.google.ca/search?q=$1" into the text area. save the service3 with whatever name you like. This service will use Firefox to search for selected text in google. if you want to use a different browser, replace -a FireFox with whatever (-a Camino, -a Opera, -a SeaMonkey). If you want to choose a browser at run time that will take an extra action - ask if you can't figure it out.

I'm using Google Chrome and its doesn't work with me
spoow is offline   Reply With Quote
Old 02-10-2011, 09:49 AM   #18
tw
Hall of Famer
 
Join Date: Apr 2007
Posts: 4,262
Quote:
Originally Posted by spoow
I'm using Google Chrome and its doesn't work with me

and this surprises you?
__________________
Philosophy is a battle against the bewitchment of our intelligence by means of language. -LW-
tw is offline   Reply With Quote
Old 02-20-2011, 04:56 AM   #19
spoow
Prospect
 
Join Date: Feb 2011
Posts: 7
Quote:
Originally Posted by tw
ok, here's how you do it. Open Automator, select Service from the popup that appears. At the top of the window, make sure it says "Service receives selected text in any application", and that the 'replaces text' checkbox is off. now add the action Run Shell Script (you can find that in the 'Utilities' section). Leave the shell as /bin/bash, set the 'pass input' pulldown menu to say as arguments, delete the default for-loop text that appears, and enter open -a FireFox "http://www.google.ca/search?q=$1" into the text area. save the service3 with whatever name you like. This service will use Firefox to search for selected text in google. if you want to use a different browser, replace -a FireFox with whatever (-a Camino, -a Opera, -a SeaMonkey). If you want to choose a browser at run time that will take an extra action - ask if you can't figure it out.

i'm trying to contact you are available thanks
spoow is offline   Reply With Quote
Old 02-20-2011, 04:57 AM   #20
spoow
Prospect
 
Join Date: Feb 2011
Posts: 7
Quote:
Originally Posted by tw
and this surprises you?

yeah its , how can i fix it please?
spoow is offline   Reply With Quote
Reply

Tags
google services browser

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 06:00 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.