
So now that you have created a script, we need to add stuff into the file. A window should have popped up, probably Notepad.Find the newly created file on your desktop and right-click it.Click "AutoHotkey Script" inside the "New" menu.
AutoHotkey is not magic, we all wish it was, but it is not. Once you have AutoHotkey installed, you will probably want it to do stuff.
Once done, great! Continue on to section b. The downloaded file should be named AutoHotkey_*_setup.exe or similar. This documentation is for v2, so choose that option or switch to the v1 documentation. You should be presented with an option for each major version of AutoHotkey. For this guide we will use the Installer since it is easiest to set up.
But that depends on the version you want. After downloading it, you may possibly need to install it. Since you're viewing this documentation locally, you've probably already installed AutoHotkey and can skip to section b.īefore learning to use AutoHotkey (AHK), you will need to download it. If you get confused, try reading the section again. You can copy and paste most examples on this page. For optimal learning power, it is advised that you read the text and try the code. Throughout this tutorial you will see a lot of text and a lot of code.
Function Calls with or without Parenthesesīefore we begin our journey, let me give some advice.
How to find the help file on your computer. Beginner Tutorial | AutoHotkey v2 AutoHotkey Beginner Tutorial by tidbit Table of Contents set ( 'Clipboard', "Copied text!" ) print ( isNotepadActive )įrom ahkunwrapped import Script ahk = Script ( ''' LuckyMinimize(winTitle). f ( 'WinActive', 'ahk_class Notepad' ) # built-in variables (and user globals) can be set directly ahk. ) get(var) set(var, val) from ahkunwrapped import Script ahk = Script () # built-in functions are directly callable isNotepadActive = ahk. Persistent Windows notification area settings.Ĭall(proc. Descriptive errors with accurate line numbers. Supports PyInstaller for onefile/onedir installations. Separate auto-execute sections to ease scripting. Won't explode when used from multiple threads. Unhandled AHK exceptions carry over to Python. Errors for unsupported values ( NaN Inf \0). Warnings for loss of precision (maximum 6 decimal places). Hypothesis powered testing of convoluted unicode, et al. Execute arbitrary AHK code or load scripts. Instead, we bundle and bridge AutoHotkey.exe, sending your initial script via stdin with minimal boilerplate to listen for window messages from Python and respond via stdout. I wanted to automate Windows with the coverage and simplicity of the complete AutoHotkey API, yet code in Python, so I created ahkUnwrapped.ĪutoHotkey already abstracts the Windows API, so another layer to introduce complexity and slowdowns is undesirable.