AutoHotKey is a great tool. In an article posted earlier this year in the Help Desk Geek, I explained how to disable keys on Windows using AutoHotKey. However, this is just one of the countless tricks that can be achieved 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 ten years now, I have an ever-changing AutoHotKey script in my Windows startup – without what it allows, I will be completely lost.
Let me share with you five of the most useful AutoHotKey scripts for everyday PC use. While I have laid out a more detailed explanation of installing, configuring, and scripting using AutoHotKey in the above article, all you need to do is download the application, invoke a text editor, and save and run any of the following scripts to get them working immediately.
Change the assignment of function keys
Reuse the function keys
For many of us, the function keys (F1 – F12) are completely unused. Depending on your keyboard layout, accessing this row of keys can be an awkward compromise when compared to their functionality. For others, these keys may just be useless.
My favorite thing is to use the function keys to customize them to launch programs that I use frequently but don’t always leave open. Notepad is a great example.
F1 :: Run “% WINDIR% notepad.exe”
The above script sets the F1 key to launch Notepad on any modern version of Windows. As you can see, the file path supports both a direct path and one of the Windows environment variables. Using environment variables is ideal if you are using several different versions of Windows.
– /
Use special characters
Use special characters
I’m a big fan of em dash and it disappoints me 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 you press Alt + -. Alt is a great hotkey modifier because it is much less useful than Shift and Ctrl.
Another useful idea is to bind the ellipsis to Alt +., Which can be accomplished with the following one-liner:
!. :: Send {…}
As a writer, using AutoHotKey to easily access punctuation marks saves me an incredible amount of time.
Control the volume
Control your volume
Not everyone has a keyboard that supports multimedia keys, but that shouldn’t stop anyone from the pleasure of effortlessly controlling their music.
My favorite way to do this is to use the Shift + Page Up keys to increase the volume, Shift + Page Down to decrease the volume, and Shift + Pause to mute (switchable).
+ PgUp:: Send {Volume_Up} + PgDn :: Send {Volume_Down} + Pause :: Send {Volume_Mute}
Of course, chances are that you are using a keyboard where such a layout is not very practical. You can simply change any of the key names above to your liking by checking the AutoHotKey list.
Dock window on top
Install a window on top
This may be my favorite AutoHotKey one-liner of all. The ability to dock a window on top of others is something that can save you some serious headaches when working, watching a movie, or many other things at your desk.
^ Space :: Winset, AlwaysOnTop ,, ?
I find this especially useful if you have a decent sized monitor but not a dual monitor system. With the above script, this calculator will no longer be hidden under all your other windows! Just press Ctrl + Space to dock (or unpin) the window.
Instant Google Search
Search Google right away
If you use a computer every day, you’re probably spending more time than you notice searching Google for terms that you come across when talking with friends or browsing the web.
However, selecting text, copying it, opening a new tab, pasting text into the address bar, and pressing the Enter key is an awfully long process. Why not make it easier?
^ + c :: Send ^ c Sleep 50 Run “http://www.google.com/search?q=%clipboard%” return
The above script allows the keyboard shortcut Ctrl + Shift + C to do it all with a single keystroke while you have selected the text you want to search for. The Google search page will open in your default browser.
If you can’t choose just one of these scripts, there is good news: all you have to do is insert each one on a new line and they will all work together seamlessly!
Unless you’ve changed the hotkeys to create conflicts, using all five of the above scripts at the same time in a single AHK file should work fine.
–