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.
- Download and install FastScripts.
-
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
- Click on the FastScripts icon in your menu bar, go into the ‘FastScripts’ item, and then click ‘Preferences’.
- Click the ‘Script Shortcuts’ tab, and double click the script you just saved. FastScripts will record the next keyboard shortcut you enter.
- Now you should be able to load a page in your web browser by using that keyboard shortcut.
My products
💅 Vanilla – hide icons from your Mac menu bar for free
🚀 Rocket – super-fast emoji shortcuts everywhere on Mac… :clap: → 👏
📖 Kubernetes – my book on Kubernetes for web app developers
😄 Emoji Bullet List – easily emojify your bullet point lists (like this one!)
Jump on my email list to get sent the stuff that’s too raunchy for the blog.
(Seriously though, it’s a once-a-month update on apps I’ve built, tips for your Mac, and other relevant info.)
💅 Vanilla – hide icons from your Mac menu bar for free
🚀 Rocket – super-fast emoji shortcuts everywhere on Mac… :clap: → 👏
📖 Kubernetes – my book on Kubernetes for web app developers
😄 Emoji Bullet List – easily emojify your bullet point lists (like this one!)
Jump on my email list to get sent the stuff that’s too raunchy for the blog.
(Seriously though, it’s a once-a-month update on apps I’ve built, tips for your Mac, and other relevant info.)