Windows only: If you’ve ever wanted to assign a shortcut key directly to your favourite applications, you can do so easily with this simple AutoHotkey script.
The general idea of the function is that you can assign a specific hotkey to a specific window — when you press the shortcut key once, the window will come to the foreground, and if you press it again, the window will minimise. This way you can toggle between the windows you use most often, without having to bother with Alt-Tab.
To make your own AutoHotkey script for restoring a specific window, create a new *.ahk script and paste in the following code:
WinGet, winid, ID, %TheWindowTitle%
DllCall(“SwitchToThisWindow”, “UInt”, winid, “UInt”, 1)
Now that you have the function, you can start using it to create your own hotkeys for specific applications with a line similar to this one, which would assign Alt+X to toggle Firefox between being minimised and active.
This script is courtesy of the Lifehacker Coders group over on Productive Geek forums, and reader bobbo33 is the AutoHotkey wizard that figured out how to make it work for any window, and solved a long-standing problem I’ve personally had with the WinRestore function. Thanks, bobbo33!
Use AutoHotkey to Assign a Hotkey to a Specific Window [Productive Geek]