Quick Google look-up of selected text

Press Alt+G after selecting the text

;Google lookup
!g::
OldClipboard:= Clipboard
Clipboard:= ""
Send, ^c ;copies selected text
ClipWait
Run http://www.google.com/search?q=%Clipboard%
Sleep 200
Clipboard:= OldClipboard
Return

 

Edit: Part of the script had been converted to a link and was not showing properly. I've now edited this.

Parents
  • Hi Nora,

    I'm very interested this script. I frequently use google to search words during translation. I never used AHK before. It seems very powerful. I just tried this script. When I press Alt+G, only the google search window pops up. The selected texts are not pasted into the search box. Would you please kindly advise what to do at your convenience? Thanks,

    Regards,
    Ivan
  • Unknown said:
    Hi Nora,

    I'm very interested this script. I frequently use google to search words during translation. I never used AHK before. It seems very powerful. I just tried this script. When I press Alt+G, only the google search window pops up. The selected texts are not pasted into the search box. Would you please kindly advise what to do at your convenience? Thanks,

    Regards,
    Ivan
     

    Hi Ivan,

    Paul has posted an alternative script but just to follow up, I think I see why it's not working for you (and for Paul). When I pasted the script on this forum, part of it got converted into a link, which is not what you need. This is my actual script:

    ;Google lookup
    !g::
    OldClipboard:= Clipboard
    Clipboard:= ""
    Send, ^c ;copies selected text
    ClipWait
    Run http://www.google.com/search?q=%Clipboard%
    Sleep 200
    Clipboard:= OldClipboard
    Return

     

    As you can see, the part of the variable, called %Clipboard%, where the contents of the clipboard are pasted into the search field, was not showing in the original post.

    Hope it works for you now!

    Best,

Reply
  • Unknown said:
    Hi Nora,

    I'm very interested this script. I frequently use google to search words during translation. I never used AHK before. It seems very powerful. I just tried this script. When I press Alt+G, only the google search window pops up. The selected texts are not pasted into the search box. Would you please kindly advise what to do at your convenience? Thanks,

    Regards,
    Ivan
     

    Hi Ivan,

    Paul has posted an alternative script but just to follow up, I think I see why it's not working for you (and for Paul). When I pasted the script on this forum, part of it got converted into a link, which is not what you need. This is my actual script:

    ;Google lookup
    !g::
    OldClipboard:= Clipboard
    Clipboard:= ""
    Send, ^c ;copies selected text
    ClipWait
    Run http://www.google.com/search?q=%Clipboard%
    Sleep 200
    Clipboard:= OldClipboard
    Return

     

    As you can see, the part of the variable, called %Clipboard%, where the contents of the clipboard are pasted into the search field, was not showing in the original post.

    Hope it works for you now!

    Best,

Children