Open Google Maps from a Selected Address

How to create this keyboard shortcut in five minutes!

Introduction

Google Maps

Are you using Google Maps? Do you have to select an address, copy it to the clipboard, start Google Maps, paste the address, and finally hit “enter” to get the location? If you are doing this again and again, keep reading! This 5-minute how-to will explain the process of creating a keyboard shortcut that will automate these steps.

What you need: ShortKeeper (info & free download), https://cedeq.com/shortkeeper/en

Note: ShortKeeper is not a Google Chrome add-in; it is a Windows application for creating keyboard shortcuts. You can use it to speed up just about anything, including logging in to websites, opening folders, inserting text, and much more. Improved efficiency guaranteed!

How to in 5 minutes

ShortKeeper UI

  1. In the left column, select the command “Run AutoHotkey code”.
    Note: The order of commands in the list can change. The Up/Top/Dn/Bot buttons at the bottom of the list let you move up your most useful command(s).

  2. In the center column, click the button New.
    Note: If you don’t click New you will be editing the selected shortcut in the right column instead of creating a new one.

  3. In the DESC field (center column), type “Google Maps”.

  4. In the PARAM field, paste the following code:
    ClipSaved := ClipboardAll
    Clipboard =
    SendInput, ^c
    ClipWait, 2
    if ErrorLevel 
    {
      MsgBox % "Failed attempt to copy text to clipboard."
    }
    else
    {
      SelectedAddress := Trim(Clipboard)
      StringReplace,SelectedAddress,SelectedAddress,`n,%A_SPACE%,A
      StringReplace,SelectedAddress,SelectedAddress,`r,,A
      run % "https://www.google.com/maps/search/" . SelectedAddress . "/"
    }
    Clipboard := ClipSaved
    

  5. In the HOTKEY section, click Ctrl and select M.

  6. Finally, click Save.
    Note: Selecting any other item in the Saved column, hitting Esc, or clicking the New button will discard any unsaved changes.

That's it! Pressing Ctrl+M will bring the address up in Google Maps (if AutoHotkey is running).

Note: If AutoHotkey is not running, just start it with the Start/Stop AutoHotkey button. It is possible to set an option (in the “Option” tab) to start AutoHotkey automatically at Windows start-up. There is also an option to start AutoHotkey automatically when ShortKeeper starts. A small hand icon in the system tray, usually at the bottom right of the screen, will indicate that AutoHotkey is active.

More Info

The selected address can be on several lines. New lines will be replaced with spaces.

If ever Google changes the way its map webpage works, this script may stop working. If you experience any problems, please let us (and the community) know with a post on the following ShortKeeper forum thread: https://cedeq.com/forums/showthread.php?tid=1. This will allow someone to correct the script. You can subscribe to the thread to be notified of any updates.

The AutoHotkey script is optimized to be used with ShortKeeper. As such, there is no “Return” at the end and variable(s) don’t need to be cleared. ShortKeeper will do this automatically.

ShortKeeper includes AutoHotkey (as its shortcut processor). When you are finished with this tutorial, you could close ShortKeeper, and AutoHotkey will continue processing your keyboard shortcut(s) in the background. ShortKeeper is only needed to add/modify/delete shortcuts, manually start/stop AutoHotkey, and set certain operating options.

Download ShortKeeperForum