Matthew Palmer

Open a Webpage with a Keyboard Shortcut on Mac OS X

Augustus asked me a question on Twitter.

@_matthewpalmer saw ur article abt keyboard remapping. Is it possible to create a script(?) that remaps one's key to direct them to a URL?

— Augustus Sung (@agussung) February 2, 2015

Here’s how to open a webpage by remapping a keyboard shortcut on Mac OS X.

  1. Download and install FastScripts.
  2. Save the following in Script Editor to /Users/<username>/Library/Scripts, changing the URL as required.

    set website to "http://google.com"
    do shell script "open " & website
    
  3. Click on the FastScripts icon in your menu bar, go into the ‘FastScripts’ item, and then click ‘Preferences’.
  4. Click the ‘Script Shortcuts’ tab, and double click the script you just saved. FastScripts will record the next keyboard shortcut you enter.
  5. Now you should be able to load a page in your web browser by using that keyboard shortcut.
Follow me on Twitter