Just download, open in text editor, save and run
AutoHotKey is a beautiful tool. In an article published near the start of the year over at Help Desk Geek, I explained how to disable keys in Windows using AutoHotKey. However, that’s just one of the countless tricks that you can achieve with this software.
With just a few lines of code, you can create something that will change the way you use your keyboard and PC for years to come. For more than a decade now, I’ve had an ever-changing AutoHotKey script sitting in my Windows startup – without some of what it enables, I’d be completely lost.
Let me share with you five of the most useful AutoHotKey scripts for everyday PC use. While I laid out a more detailed explanation for installing, setting up, and creating scripts using AutoHotKey in the aforementioned article, all you have to do is download the application, bring up a text editor, and save and run any of the following scripts to get them working immediately.
Repurpose The Function Keys
For many of us, the function keys (F1–F12) end up completely unused. Depending on your keyboard layout, the reach to this row of keys could be an uncomfortable trade-off compared to their functionality. For others, these keys may simply be useless.
My favorite thing to do with the function keys is to set them to launch programs that I often use but don’t often keep open. Notepad is a great example.
F1::Run "%WINDIR%\notepad.exe"
The above script sets the F1 key to launch Notepad in any modern version of Windows. As you can see, the file path supports both a direct path or one of Windows environment variables. Using environment variables is ideal if you use multiple different versions of Windows.
Use Special Characters
As a massive fan of the em dash, it’s frustrating that the vast majority of keyboards don’t natively support it—so, let’s make them.
!-::Send {—}
The above script will insert an em dash when the Alt + – keys are pressed. Alt is a great modifier to use for your hotkeys because it sees much less use compared to Shift and Ctrl.
Another solid idea is to bind ellipsis to Alt + ., which can be performed with the following one-liner:
!.::Send {…}
As a writer, using AutoHotKey for easy access to punctuation marks saves me an incredible amount of time.
Control Your Volume
Not everyone has a keyboard that supports multimedia keys, but that shouldn’t stop anyone from the joys of controlling their music with ease.
My favorite way of implementing this is by using the Shift + Page Up key to turn the volume up, Shift + Page Down key to turn the volume down, and Shift + Pause key to mute (toggleable).
+PgUp::Send {Volume_Up}
+PgDn::Send {Volume_Down}
+Pause::Send {Volume_Mute}
Of course, there’s the chance that you may be on a keyboard where that layout isn’t very practical. You can simply change any of the key names above to your liking by checking out AutoHotKey’s list of keys.
Pin a Window On Top
This might be my favorite AutoHotKey one-liner of them all. The ability to pin a window on top of others is one that can save you a major headache while working, trying to enjoy a movie, or plenty of other activities at your desk.
^Space::Winset, AlwaysOnTop, , A
I find this one to be especially useful if you have a decent-sized monitor but not a dual-monitor setup. With the script above, that calculator will no longer get buried under all of your other windows! Just press Ctrl + Space to pin (or unpin) a window.
Search Google Instantly
If you’re someone who uses your computer every single day, you probably spend more time than you notice searching Google for terms that you come across while talking to friends or surfing the web.
However, selecting text, copying it, opening a new tab, pasting the text into your address bar, and pressing the Enter key is an awfully long process. Why not make it simpler?
^+c::
Send ^c
Sleep 50
Run "http://www.google.com/search?q=%clipboard%"
return
The script above allows the Ctrl + Shift + C hotkey to do all of that in a single hotkey as long as you’ve highlighted the text you want to search for. The Google Search page will be brought up in your default browser.
If you can’t pick just one of these scripts, there’s good news: All you have to do is paste each of them on a new line, and they’ll all work seamlessly together!
As long as you haven’t altered the hotkeys to create conflicts, using all five of the above scripts at once within a single AHK file should work perfectly fine.