Page 1 of 1

fast google search

Posted: Feb 26th, ’14, 15:56
by user_7788
Hello,

I wanted to know is there is a way to launch a instant googl search with a string I'll write. I explain.

For example, from anywhere I write gg mytext (then i press enter) and this will launch my browser with a google search "my text".

More of this.
Often, i start to write something in my google address bar without to know (when i start to write) if i want a "search" or a "get kucky". (i know this AFTER the string writed)
Would it be possible to, from anywhere, write gg mytext G (then enter, to launch a search with google) and if i write gg mytext L (then enter, will lauch get lucky) or if a wirte gg mytext W (will laucnch wikipedia searc)

I would like to (if i was working on a doc for example) my text "gg blabla G" be removed from my doc after the searching launched.

Thank you anyway for this beautiful software.

Re: fast google search

Posted: Feb 26th, ’14, 22:36
by Marko
Here is one idea. You can type "MyText ggg" or "MyText ggw" to search for MyText.

The code selects the word on the left by sending a Ctrl-Shift-Left, copies the selected word to the clipboard by Ctrl-C and finally runs a google/wiki search.

Use the Text Expander to set two entries:

1.
String: ggg
Type: Command
Substitute:

Code: Select all

send ^+{left}
Send ^c
Sleep 50
Run, http://www.google.com/search?q=%clipboard%
Options: Trigger immediately

2.
String: ggw
Type: Command
Substitute:

Code: Select all

send ^+{left}
Send ^c
Sleep 50
Run, http://en.wikipedia.org/wiki/Special:Search?search=%Clipboard%
Options: Trigger immediately

Re: fast google search

Posted: Feb 27th, ’14, 09:00
by user_7788
Thank you a lot :)

I'm encountering two issues :

1 : when i write the code (even if i paste it) into my text expander substitute" and then i save it ; my "susbstitute" is blank whan i want to edit it. It seems to not save the code each time i write it.

2. This command is very good for a word, is there a way to do it for a sentence ? Eventually by taping first a ggg and then my string and then ggg again ?

Thank you :)

Re: fast google search

Posted: Feb 27th, ’14, 09:11
by Marko
here is the updated command which will search for the sentence on the left from the string.

Code: Select all

send +{Home}^c
Sleep 50
StringGetPos, pos, Clipboard, ., r1
StringTrimLeft, MyClip, Clipboard, pos+1
myclip=%myclip%
Run, http://www.google.com/search?q=%MyClip%

Re: fast google search

Posted: Feb 27th, ’14, 17:48
by user_7788
So great ! Thank you a lot !

Re: fast google search

Posted: Mar 7th, ’14, 00:03
by Comick
This was a great learning excercise for me, thanks. I study more Autohotkey commands as it looks like the possibilities are unlimited and anything can be done... I was already able to adapt the above slightly to suit my needs. Excellent!

Re: fast google search

Posted: Apr 4th, ’14, 13:20
by ssystem
+1