AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

google and wikipedia search from any application

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
sagarmehta
Guest





PostPosted: Fri Nov 11, 2005 12:07 pm    Post subject: google and wikipedia search from any application Reply with quote

;Following are the scripts which people would find useful for searching using google or wikipedia

;Just select any word or text from any application and press a hotkey, and the google or

;wikipedia results are in your hands

;Hokey is Win + g
#g::

Send,^c

Run, http://www.google.com/search?hl=en&lr=&rls=GGLD%2CGGLD%3A2005-38%2CGGLD%3Aen&q=%Clipboard%

return


;Hokey is Win + w
#w::

Send,^c

Run, http://en.wikipedia.org/wiki/Special:Search?search=%Clipboard%&go=Go

return


; Visit my website at www.sagarmehta.org

; Any comments or suggestions are welcome at sagarmehta@gmail.com
Back to top
WileECoyote



Joined: 04 Nov 2005
Posts: 9

PostPosted: Fri Nov 11, 2005 12:59 pm    Post subject: improvement Reply with quote

Hi there,
I'm using these shortcuts for a long time and I already created some improvements (e.g. open an input box) to them. Maybe they're helpful to you or someone else.

Code:

; ***** Wikipedia functions *****

; Win-w : show input box and search for entered text
#w::Run, "WikiSearch.ahk"


; Win-Shift-w : search for selected text in wikipedia
+#w::
oldClipboard=%clipboard%
Send, ^c
text=%clipboard%
clipboard=%oldClipboard%
Run, http://de.wikipedia.org/wiki/Spezial:Search?search=%text%
;Run, http://de.wikipedia.org/wiki/Spezial:Search?search=%text%&fulltext=Suche
return


; Win-Ctrl-w : open wikipedia.de in web browser
^#w::Run, http://www.wikipedia.at



; ***** english-german functions *****

; Win-e : show input box and translate entered text
#e::Run, "leo_en_de.ahk"


; Win-Shift-e : search for selected text at LEO english-german
+#e::
oldClipboard=%clipboard%
Send, ^c
text=%clipboard%
clipboard=%oldClipboard%
Run, http://dict.leo.org/?lp=ende&lang=de&searchLoc=0&cmpType=relaxed&relink=on&sectHdr=on&spellToler=std&search=%text%
return


; Win-Ctrl-e : open dict in web browser
^#e::Run, http://dict.leo.org



; ***** french-german functions *****

; Win-f : show input box and translate entered text
#f::Run, "leo_fr_de.ahk"


; Win-Shift-f : search for selected text at LEO french-german
+#f::
oldClipboard=%clipboard%
Send, ^c
text=%clipboard%
clipboard=%oldClipboard%
Run, http://dict.leo.org/?lp=frde&lang=de&searchLoc=0&cmpType=relaxed&relink=on&sectHdr=on&spellToler=std&search=%text%
return


; Win-Ctrl-f : open dico in web browser
^#f::Run, http://dico.leo.org


These script comes together with 3 other scripts:

leo_en_de.ahk
Code:

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         Christian Schüler <c_schueler@gmx.at>
;
; Script Function:
;
; Opens an input box and searches at dict.leo.org (english-german) for the entered text.

Gui, Add, Text,, Keywords:
Gui, Add, Edit, w160 vKeywords ym        ; The ym option starts a new column of controls.
Gui, add, button, default, &Translate   ; ButtonSearch will be the label for this button
Gui, add, button, X+15, &Cancel      ; ButtonCancel
Gui, Show,, Translate english-german
return  ; End of auto-execute section. The script is idle until the user does something.

ButtonTranslate:
Gui, Submit  ; Save the input from the user to each control's associated variable.
Run, http://dict.leo.org/?lp=ende&lang=de&searchLoc=0&cmpType=relaxed&relink=on&sectHdr=on&spellToler=std&search=%Keywords%

ButtonCancel:
GuiClose:
ExitApp


leo_fr_de.ahk
Code:

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         Christian Schüler <c_schueler@gmx.at>
;
; Script Function:
;
; Opens an input box and searches at dico.leo.org (german-french) for the entered text.

Gui, Add, Text,, Keywords:
Gui, Add, Edit, w160 vKeywords ym        ; The ym option starts a new column of controls.
Gui, add, button, default, &Translate   ; ButtonSearch will be the label for this button
Gui, add, button, X+15, &Cancel      ; ButtonCancel
Gui, Show,, Translate french-german
return  ; End of auto-execute section. The script is idle until the user does something.

ButtonTranslate:
Gui, Submit  ; Save the input from the user to each control's associated variable.
Run, http://dict.leo.org/?lp=frde&lang=de&searchLoc=0&cmpType=relaxed&relink=on&sectHdr=on&spellToler=std&search=%Keywords%

ButtonCancel:
GuiClose:
ExitApp


WikiSearch.ahk
Code:

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         Christian Schüler <c_schueler@gmx.at>
;
; Script Function:
;
; Opens an input box and searches at www.wikipedia.at for the entered text.
;
 

Gui, Add, Text,, Keywords:
Gui, Add, Edit, vKeywords ym  ; The ym option starts a new column of controls.
Gui, add, button, default, &Search   ; ButtonSearch will be the label for this button
Gui, add, button, X+15, &Cancel      ; ButtonCancel
Gui, Show,, Wikipedia Search
return  ; End of auto-execute section. The script is idle until the user does something.

ButtonSearch:
Gui, Submit  ; Save the input from the user to each control's associated variable.
Run, http://de.wikipedia.org/wiki/Spezial:Search?search=%Keywords%

ButtonCancel:
GuiClose:
ExitApp


Unfortunately I don't know how to insert these as files, so I inserted their source code.

Christian
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group