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

  1. Go to https://www.autohotkey.com/ to download, select Download Current Version, and save the file.
  1. Run the installation file by double-clicking it from your downloads folder, and select Express Installation.
  1. Once AutoHotkey installs, click Exit.

Create Your First AutoHotkey Script

  1. Navigate to your Documents\AutoHotkey folder or wherever you would like to place your scripts.
  2. Right-click and select New >> AutoHotkey Script. Save the filename as whatever you would like, for instance, “My_First_AHK_Script.ahk“.
  1. Right-click on your new script and click Edit. The script will open in your default text editor (Notepad, Notepad++, etc.)
  2. 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)

  1. Save your script, and then double-click on the script file to run it.
  2. 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:

HAPPY SCRIPTING!