How to Use AutoHotKey Scripts to Automate Tasks

This is a beginner’s guide to creating AutoHotkey scripts. AutoHotkey is a program that allows you to create a keyboard shortcut for a task.You can call them macros or mini-programs. Scripts or mini-programs created using AutoHotKey have the .AHK extension. The programming language is simple, as you will see in this mini tutorial for AutoHotKey.

AutoHotkey Tutorial

First of all, you need to download AutoHotKey and install it on your computer. Its program icon will be in the system tray, from where you can manage all your scripts. You can also pause AutoHotkey for a while, or even exit if you don’t need to run scripts. Please note that when you exit the application in the system tray, your scripts will not work.

When you install the AutoHotKey program, you will be able to see sample scripts in Notepad. It says SHOW READ. If you leave the checkbox checked and click Finish after installation, a Windows Help window will open where you can find detailed instructions on how to use the program.

IMPORTANT . Create scripts in Notepad and save them with the .AHK extension for them to work. Select ALL FILES in the Type field (second drop-down list below the File Name text box). He shows *. * In the corresponding text box and there, you must enter AHK instead of TXT. If you save as TXT, the script won’t work.

How to use AutoHotkey scripts

Below is a quick guide to using AutoHotkey.

Special keys (CTRL, ALT, SHIFT, WINDOWS keys)

When you create scripts, you assign them to keys. In most cases, you have to assign them to special key combinations followed by regular keys. Special keys in this regard are WINDOWS KEY, CTRL, SHIFT and ALT. You can use one or more special keys to assign your scripts. For example, you can assign a script to the CTRL + SHIFT + S key combinations. In this case, you need to enter special keys in the format provided by AutoHotKeys.

CTRL is represented by ^

SHIFT is presented +

ALT is presented!

Windows key is represented by #

:: part ends the hotkey combination and the script follows

First, you need to type a special key combination that will activate the script you created. For example, if you wanted to assign CTRL + SHIFT + S to launch Google, your script would look like this:

^ + S :: Run

Special words or commands

Use RUN to run a program or website . For example, if you create the following:

! ^ F :: Launch Notepad

With the above script, when you press ALT + SHIFT + F, Notepad is launched. RUN is a keyword that helps you launch a program or launch a website. Another example below shows how the hotkey opens Google in your default program and then launches Notepad.

^ + E ::Run google.comLaunch NotepadReturn

All four lines above are one script that is activated with the keyboard shortcuts CTRL + SHIFT + E. The word RETURN is another keyword that indicates the end of the script when you use multiple lines. Whenever you create a script with more than one line, you must use RETURN at the end of the script so that AutoHotKey knows the script ends here.

You can add as many commands as you like to one AHK file, but remember to use RETURN at the end of the last script in the AHK file. You need to run the AHK file by double clicking on it before you can use scripts

Another keyword to use is SEND . It sends keystrokes to the shell and you can use it to create things like signatures, etc. See next example.

^! S ::Best regards, {ENTER} Arun KumarReturn

In the above script, when I press CTRL + ALT + S, it inserts Regards , then the Enter key (to change the line) and then Arun Kumar inserts . The above example shows how to type the Enter key. The ENTER key is always enclosed in curly braces {}.

Likewise, if you want to type TAB, it must be {TAB}. Likewise, the space will be {SPACE}. You don’t need to use {SPACE} to enter a space. It will be automatically filled in with a space when you type the space bar in a script like in the example above. In this example, Arun is followed by a space followed by Kumar .

by Abdullah Sam
I’m a teacher, researcher and writer. I write about study subjects to improve the learning of college and university students. I write top Quality study notes Mostly, Tech, Games, Education, And Solutions/Tips and Tricks. I am a person who helps students to acquire knowledge, competence or virtue.

Leave a Comment