AutoHotkey is one of the best tools ever created to automate almost anything on your Windows machine with a single shortcut. While there are a lot of shortcuts in Windows to help ease your workload, they are not highly customizable and you cannot create new shortcuts as required. AutoHotkey allows you to create more complex actions and macros with the hot key combinations of your choice. Here is how you can install AutoHotkey and use it to automate things in your Windows system.
What is AutoHotkey
AutoHotkey is a free, lightweight and open source application which can be used in tons of ways like binding keys, customizing your computer, data manipulation with regular expressions, complex macros, compiling scripts, etc. Since AutoHotkey is mainly intended for power users, it uses scripts written in a specific syntax to perform all those magical actions. Simply put, AutoHotkey can run any action with a single keystroke. It is more than just a regular key binding application.
Note: due to the deep interactions between AutoHotkey and your operating system, some antivirus software may flag it for virus. You can safely disregard those warnings as they are nothing more than false positives.
Installation and Usage
Before getting started, don’t get intimidated by the words “Power User” and “Scripts” as AutoHotkey is really easy to work with once you get used to it. You can download it from its official website and install it like any other software. Once installed, launch the application from the Start menu.
Once you’ve launched the application, AutoHotkey will display a window asking whether would you like to see a sample script. Simply click on the “Yes” button to see the sample script.
This action will open the sample script in Windows Notepad application. As you can see, AutoHotkey has already created a couple of shortcuts which are mapped to open AutoHotkey’s website and a new Notepad window when pressed.
To test it out, navigate to the “Documents” folder and execute the file “AutoHotkey.ahk” by double clicking on it. Now press the shortcut Win + Z to open the AutoHotkey website in your default browser and Ctrl + Alt + N to open a new Notepad window.
Now let us create a basic script to get you started. Open your Notepad application and copy and paste the below code into it. Now save it as “shortcuts.ahk,” paying attention to the extension.
If you break down the script, the first line is nothing but a comment. The second-line tells AutoHotkey that whenever you press Ctrl (^) + Shift (+) + S to run the application “calc.exe” (calculator). And the third line is nothing but you telling AutoHotkey that the statement has ended.
Now right click on the saved file and select the option “Run Script” to execute the script. Press Ctrl + Shift + S and you will have your Calculator application opened.
With AutoHotkey, you can also create custom messages which appear whenever the user presses a certain combination. For instance, copy the below script and run it.
From now on, whenever you press “Ctrl + NumberPad 0,” the pre-configured custom message will be displayed. Of course, you can make it even more complex like a message being displayed whenever you open or close a certain application, etc.
Besides running programs and displaying custom messages, you can also remap your keyboard keys. This way, you can put to use your least used keys like insert, scroll lock, etc., on your keyboard. For instance, the simple script below will remap the “Tilde” key on your keyboard to act as “BackSpace.” This is particularly helpful for those who write a lot.
If you ever want to suspend the shortcuts temporarily, simple right click on the taskbar icon and select the option “Suspend Hotkeys.” If you want to completely exit the script, just select the “Exit” option.
That’s all there is to do, and the things we discussed here are just a bit of what AutoHotkey can do. If you can learn the AutoHotkey syntax, you can do a lot more interesting things tailored for your specific needs. You can also create even more complex scripts that can really automate a lot of your daily routines saving you a lot of time in the process.
Hopefully that helps, and do comment below sharing your thoughts and experiences on using AutoHotkey.