Get domain from email address
Posted: Jun 11th, ’19, 17:47
Hi,
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
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 somedomain.com
Thanks for your help.
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
who [email protected]
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
SearchText:=Trim(SearchText)
if (Prefix="g")
{
//Do something.
}
else if (Prefix="who")
{
Run, "www.google.com/search?hl=en&q=%SearchText%" //open browser and searches google for the email address
Run, "%SearchText%" //should open a new tab browser and go to the URL
}
return