perform Google search for a highlighted term on a specific website Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Knopf
Posts: 2
Joined: 17 Sep 2020, 13:50

perform Google search for a highlighted term on a specific website

Post by Knopf » 17 Sep 2020, 13:56

Hello,

I already know how to do a Google search for the exact wording of a highlighted term. To do this I use the following script:

Code: Select all

;Google lookup
!g::
OldClipboard:= Clipboard
Clipboard:= ""
Send, ^c ;copies selected text
ClipWait
Run http://www.google.com/search?q=`%22%Clipboard%`%22  
Sleep 200
Clipboard:= OldClipboard
Return
[Mod edit: [code][/code] tags added. Link fixed.]

Now I would like that Google is searching for the highlighted terms on a specific page. (in Google I would enter for example "highlighted term" site:ec.europa.eu).
I tried to modify the script to automatize this kind of search, but no way. I am too much of a Beginner with AHK to do this.

Do you have any ideas?

User avatar
TheDewd
Posts: 1446
Joined: 19 Dec 2013, 11:16
Location: USA

Re: perform Google search for a highlighted term on a specific website  Topic is solved

Post by TheDewd » 17 Sep 2020, 14:00

Code: Select all

#SingleInstance, Force

!g::
	ClipBak := Clipboard
	Clipboard := ""
	Send, ^c
	ClipWait
	Run, % "https://www.google.com/search?q=" Clipboard "+site%3Aec.europa.eu"
	Sleep, 200
	Clipboard := ClipBak
return
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.

Knopf
Posts: 2
Joined: 17 Sep 2020, 13:50

Re: perform Google search for a highlighted term on a specific website

Post by Knopf » 17 Sep 2020, 14:05

Amazin that does work. Thank you so much.

User avatar
Yakshongas
Posts: 591
Joined: 21 Jan 2020, 08:41
Facebook: Yakshongas

Re: perform Google search for a highlighted term on a specific website

Post by Yakshongas » 17 Sep 2020, 14:08

Code: Select all

!g::
    OldClip := Clipboard
    Clipboard := ""
    Send, ^c
    ClipWait
    Trim(Clipboard), StrReplace(Clipboard, " ", "+")
    Run, % "Http://www.google.com/search?q=ec.europa.eu:" . Clipboard
    Sleep, 200
    Clipboard := OldClip
Return
i wuz too slow
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹

Post Reply

Return to “Ask For Help”