Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keyboard Shortcut - Get Geolocation Data of a Selected IP address
This following script will help you quickly bring up geolocation data for a selected IP address. The script works by copying selected content to the clipboard, which, if it looks like an IPv4 address (e.g., will start “” with your default browser. The IP address is automatically entered as a query. This will give you the geolocation data for the IP address.

Need help creating a keyboard shortcut with ShortKeeper using the following AutoHotkey code? This 5-minute tutorial will help!
ClipSaved := ClipboardAll
Clipboard =
SendInput, ^c
ClipWait, 2
if ErrorLevel
  MsgBox % "Failed attempt to copy text to clipboard."
  IpAddress := Trim(Clipboard)
  FoundPos := RegExMatch(IPAddress, "^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$")
  if (FoundPos)
    Run % "" . IpAddress
    MsgBox % "Invalid IPv4 address selected!"
Clipboard := ClipSaved

The script will restore the previous clipboard content.

Spaces and tabs at the beginning and end of the selection will be omitted from the selection.

An error message will be displayed (line #7) if nothing is selected. The IP address verification occurs at line #12.

If you would like to launch the geolocation website ( with a non-default web browser, replace line #14 with one of the following:

For Chrome
Run % "chrome.exe " . "" . IpAddress

For Edge
Run % "microsoft-edge:" . IpAddress

For Firefox
Run % "firefox.exe " . "" . IpAddress

For Internet Explorer
Run % "iexplore.exe " . "" . IpAddress
Enterpad: For those who need more than a few shortcuts.


Messages In This Thread
Keyboard Shortcut - Get Geolocation Data of a Selected IP address - by denilama - 03-16-2018, 08:29 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)