If you’re like most people, you use your keyboard to control your computer. But what if you want to open a window in a specific application? Or maybe you want to quickly switch between windows on the same application? You can assign hotkeys to any window on your computer with a few simple steps. ..


How did I accomplish this? AutoHotkey, a small scripting framework that allows you to automate anything in Windows. Before we begin, I’m going to assume that you’ve downloaded and installed it.

I’ve created a small function that you can add to a script which will do the hard work of finding and toggling the window. All you have to do is assign the hotkeys you want at the top of the script.

The first thing you will need to do is download the script and save it somewhere useful. You should be able to simply double-click on the script to start it, and then you will notice a new tray icon (The green one with the H)

Right-click on the icon, and choose Edit This Script from the menu. You’ll have to add in your own hotkeys since none are defined in the script, so let’s go take a look at the script…

It might be a little complicated for some of you, but the only thing we need to do is add in some hotkey lines. You’ll notice that there are a number of sample hotkey lines defined already, but commented out.

; —————————————————————– ; Function for toggling windows – Do not edit ; —————————————————————– ToggleWindow(TheWindowTitle) { SetTitleMatchMode,2 DetectHiddenWindows, Off IfWinActive, %TheWindowTitle% { WinMinimize, %TheWindowTitle% } Else { IfWinExist, %TheWindowTitle% WinActivate Else { DetectHiddenWindows, On IfWinExist, %TheWindowTitle% { WinShow WinActivate } } } }

Hotkeys are defined in this format:

For special keys, you’ll use one of the following, which can be combined. (get more information at Autohotkey documentation)

So for instance, if you wanted to trigger the keyboard shortcut of Ctrl+Alt+F and assign it to Firefox, you would use the following:

Personally, I try to use keyboard shortcuts that don’t require me to lift my hands off the keys. I simply use Alt+J assigned to Firefox because I can hit that combination without moving my hands at all.

When you are done editing the script, just save it and then go up to the H icon again, and choose the “Reload This Script” option, which will load all of your changes. If there was a problem, you’ll get an error message, and you can always use Exit to stop the script entirely.

You’ll have to decide which key combinations work best for you. My advice is to add one or two at a time, and get used to using them. Within a few days you’ll wonder how you ever lived without them. You should also read up on AutoHotkey as well… it can do much more than just this.

Note: The function ToggleWindowHide function in the script is for the more adventurous – it will toggle the window between hidden and restored… extremely useful for command prompt windows. Essentially gives me Tilda or YaKuake on Windows.

Download geek_autohotkey.ahk (Autohotkey script)