Running Your First AutoHotkey Script
AutoHotkey (AHK) is an incredible open-source Windows scripting tool that lets you create hotkey shortcuts, text expansions, macros, GUIs, workflow automations, and lots more.
Installing AutoHotkey
- Go to https://www.autohotkey.com/ to download, select Download Current Version, and save the file.
![](https://i0.wp.com/box5124.temp.domains/~thehotk1/wp-content/uploads/2021/11/image-300x136.png?resize=300%2C136)
![](https://i0.wp.com/box5124.temp.domains/~thehotk1/wp-content/uploads/2021/11/image-6-300x171.png?resize=300%2C171)
- Run the installation file by double-clicking it from your downloads folder, and select Express Installation.
![](https://i0.wp.com/box5124.temp.domains/~thehotk1/wp-content/uploads/2021/11/image-5-300x116.png?resize=300%2C116)
![](https://i0.wp.com/box5124.temp.domains/~thehotk1/wp-content/uploads/2021/11/image-9-300x223.png?resize=300%2C223)
- Once AutoHotkey installs, click Exit.
![](https://i0.wp.com/box5124.temp.domains/~thehotk1/wp-content/uploads/2021/11/image-10-300x224.png?resize=300%2C224)
Create Your First AutoHotkey Script
- Navigate to your Documents\AutoHotkey folder or wherever you would like to place your scripts.
- Right-click and select New >> AutoHotkey Script. Save the filename as whatever you would like, for instance, “My_First_AHK_Script.ahk“.
![](https://i0.wp.com/box5124.temp.domains/~thehotk1/wp-content/uploads/2021/11/image-12.png?resize=586%2C187)
![](https://i0.wp.com/thehotkeystohappiness.com/wp-content/uploads/2021/11/image-13.png?resize=653%2C93&ssl=1)
- Right-click on your new script and click Edit. The script will open in your default text editor (Notepad, Notepad++, etc.)
- Your AHK script will have a few lines of code at the top. Underneath those, copy and paste the following:
!t::
Send This is my first AutoHotkey script.
return
This defines a new hotkey that triggers when ALT+t is pressed (ALT is represented as the ! sign)
- Save your script, and then double-click on the script file to run it.
- Now that your script is running, whenever you press ALT+t, it will send “This is my first AutoHotkey script” as if you had typed it. You can try it out anywhere that accepts keyboard input, like OneNote:
![](https://i0.wp.com/thehotkeystohappiness.com/wp-content/uploads/2021/11/first_hotkey.gif?resize=495%2C298&ssl=1)
HAPPY SCRIPTING!