Google Maps from Selection

with AutoHotkey

by Denis Lamarre
last updated February 10, 2016
difficulty.png Easy

by Denis Lamarre


How are you using Google Maps? Do you have to select an address, copy it to the clipboard, find and start Google Maps, paste the address, and finally hit “enter” or click the search icon to get the location? If you are doing this again and again, you could find the following AutoHotkey script useful. Simply select the address, then press your selected Enterpad button (or your selected keyboard hotkey) to get the location.



overlay-um-googlemaps.gifPrepare your overlay
Choose an unassigned key on the Enterpad for which you want to start Google Maps. Name it something appropriate. This example uses "Google MAPS".


Code installation
Copy/paste the following script in your AutoHotkey script template (Enterpad.ahk) at the chosen key location.

  ClipSaved := ClipboardAll
  Clipboard =
  SendInput, ^c
  ClipWait, 2
  if ErrorLevel 
      MsgBox % "Failed attempt to copy text to clipboard."
  NewClipboard := Trim(Clipboard)
  Clipboard := ClipSaved
  ClipSaved =
  NewClipboard := 

More Info

The selected address (by the user) can be on several lines. Lines 12 and 13 are there to replace new lines with spaces from the clipboard (if Google doesn't do it). (USA) is used at line 16. You can use your country's Google instead (e.g.,,