AutoHotkey is a tool little known to the average user, which is surprising taking into account how useful it can be in our daily PC use. Four years ago we already published a brief introduction to it in Genbeta ...
... but today we are going to review some concrete uses that we can give to get the idea of the potential of this tool.
Before that, we are going to do a brief review of what it offers us. AutoHotkey is a script creation and execution tool, which would be text files with an .htk extension.
It is that sense, they are not very different from .bat files, which are still used today to run console scripts. However, AutoHotkey scripts are much more versatile than those.
Fundamentally, each .ahk script allows us to create an indeterminate number of 'hotkeys' (keyboard shortcuts) and 'hotstrings' (text strings that are converted to others).
We can create multiple scripts for specific tasks, or group them in a single file 'AutoHotkey.ahk' what, if we place it in the 'Documents' folder, it will start automatically every time we start the program itself (in my case, I have configured it so that the program starts together with Windows itself).
With that explained, let's see what we can do with it:
Open web pages
Imagine you want to be able quickly open a website with your default browser, like Genbeta (which one if not?). Well, three lines of script will help us do that using the key combination Ctrl + Shift + 'G':
If you preferred to use one of the function keys (like F2) for that task, you would just have to change '^ + g' for '$ F2".
Remember that (^) is equivalent to 'Control' and (+) to 'Shift'. You could also use, for example, (!), Which would be 'Alt', and (#), which would be the Windows key.
Google a text from the clipboard
If what you want is not so much to open a specific URL as Google a specific text, with the following script you would only have to copy it and, without having to open the browser window or a new tab, press Ctrl + Shift + C:
Send, ^ c
Run any application
If you want to have the execution of an application at hand, the best way may be to configure a keyboard shortcut specific to her. Let's say, for example, that we want to open Notepad by pressing Windows + N; it would be like this:
Depending on the program to open, it may be necessary to type the full path of the .exe file.
Keyboard shortcuts for volume up and down
If you do not have a multimedia keyboard with specific keys for the volume, you will like to know that the following script links volume up and down to keys '+' and '-' on the numeric keypad, and allows you to completely silence it by pressing the underused 'Pause' key:
+NumpadAdd:: Send Volume_Up
+ NumpadSub :: Send Volume_Down
break :: Send Volume_Mute
Clear the Recycle Bin
Would you like to delete the Recycle Bin with just a keyboard shortcut (let's say Windows + Del), and also save yourself from having the system ask you for confirmation? As simple as
Keep a window always on top
Using the following script, you just have to press Ctrl + Space when the window that interests us is active and it will no longer be in the foreground even if we click on the window of another program:
^SPACE:: Winset, Alwaysontop, , A
Auto-correction and text extension
Not all AutoHotkey scripts are based on running programs or using the Windows API. Some they are 'limited' to transform the text as we write it.
It can be for the purpose of autocorrect, if they are words in which a key usually dances when we write them quickly:
: * ?: Genebta :: Genbeta
Or it may be with the aim of quickly insert very long text that we usually write always the same using a keyword, like 'mymessage1':
:*?:mimensaje1::Estimado cliente, mi nombre es Tipo de Incógnito, de la Consultora SuperExperting, y le escribo personalmente con el objetivo de soltarle una párrafada sobre el aprovechamiento de sinergias innovadoras que
Or maybe what you want is quickly insert a character that we do not have at hand on the keyboard (note: lines preceded by semicolons are comments, not instructions):
;Inserta el símbolo de 'más/menos' pulsando '++--'.
: *?: ++ - :: ±
Actually, we can also use keyboard shortcuts to easily insert these characters. For example, using Alt + '-' in order to insert an em dash (which is not the same symbol as the dash):