Get domain from email address

Discussion, questions and support.
Post Reply
Posts: 13
Joined: Apr 18th, ’18, 02:13

Post by vrod5454 » Jun 11th, ’19, 17:47


How can I grab the domain from an email address (via input box) and open that domain in a browser? My input will always be an email address. So in the input box I type

Code: Select all

I am using the code below to search for the email address using google. I would like to add code that will also open a new tab and go to the domain (website). So using the example above it would be

Code: Select all

InputBox, Input, Meta search, Prefixes: g`, who`,  ,250, 250
DivPos:=InStr(Input, " ")
Prefix:=SubStr(Input, 1, DivPos-1)
SearchText:=SubStr(Input, DivPos+1)
StringReplace, SearchText, SearchText, %A_Space%, `%20, All
StringReplace, SearchText, SearchText, #, `%23, All
if (Prefix="g")
	//Do something.
else if (Prefix="who")
	Run, "" //open browser and searches google for the email address
	Run, "%SearchText%" //should open a new tab browser and go to the URL

Thanks for your help.
User avatar
Posts: 268
Joined: Nov 24th, ’15, 23:39

Post by Tom » Jun 12th, ’19, 19:58

Code: Select all

StringTrimLeft, domain, input, % InStr(input, "@")
run % "www." domain
Post Reply