AI AutoHotkey Script Generator
Describe what you want to automate in Windows and get a ready-to-run AutoHotkey v2 or v1.1 script with hotkeys, hotstrings, and window, mouse, and clipboard actions, written with the official AutoHotkey documentation.
Readme
What is AutoHotkey?
AutoHotkey is a free, open-source scripting language for Windows that automates the keyboard, the mouse, and windows. A script is a plain text file with the .ahk extension. It can turn a key combination into a shortcut that opens a program or types text, expand abbreviations as you type, remap keys, click and type for you on a timer, move and resize windows, or show small dialogs. AutoHotkey has two versions with different syntax: v2 is the current one, and v1.1 is deprecated but still runs many older scripts.
Tool description
Describe in your own words what the script should do, pick AutoHotkey v2 or v1.1, and the AI writes the complete script. Each request includes a condensed version of the official AutoHotkey documentation for the version you picked, so the AI uses the right syntax for it: in a v2 script it calls functions such as MsgBox "Hello" and WinActivate, uses #HotIf for program-specific hotkeys and A_Clipboard for the clipboard, and avoids v1 commands such as IfWinActive, StringReplace, or %variable% that would stop the script from loading.
The script appears in an editor with AutoHotkey syntax highlighting, where you can change it, copy it, or download it as a .ahk file. A comment at the top says what the script does and lists its hotkeys and hotstrings.
Features
- Scripts for AutoHotkey v2 or the older v1.1
- Hotkeys, hotstrings, key remapping, and hotkeys that only work in one program
- Window, clipboard, mouse, timer, file, and simple GUI automation
- Changeable values, such as paths, delays, and texts, kept in variables at the top
- Syntax highlighting, editing, and download as a
.ahkfile
How to run the script
- Install AutoHotkey v2 from autohotkey.com. When you start a v1.1 script, it offers to download v1.1 as well.
- Download the file, or paste the script into a new text file and save it with the
.ahkextension in UTF-8. - Double-click the file to start it. A green H icon appears in the notification area of the taskbar while the script runs.
- Right-click the icon to reload, pause, suspend hotkeys, or exit the script. To start the script with Windows, put a shortcut to it in the folder that opens with Win + R and
shell:startup.
Tips
- Name the keys you want, such as Ctrl+Alt+N or F8. Otherwise the AI picks hotkeys that don't clash with common shortcuts.
- Name the program by its window or executable, such as Chrome, Notepad, or Excel, when a hotkey should only work there.
- Say how a repeating action should stop, for example the same hotkey again or Esc.
- Read the script before you run it. AutoHotkey can press keys and click anywhere, so test new scripts where a stray keystroke does no harm.
FAQ
Should I choose v2 or v1.1?
Choose v2 unless you need to add to an existing v1.1 script. v1.1 is deprecated and gets no new features, and the two versions can't be mixed in one script. The #Requires line at the top tells AutoHotkey which version runs the script.
The script shows an error when it starts. What can I do?
AutoHotkey checks the whole script when it loads and shows the line with the problem. Make sure the version you installed matches the #Requires line, then fix the line by hand or describe the problem in a new request.
Can a script work in games? Some games ignore the fast input that AutoHotkey sends by default or block it on purpose. Ask for slower key presses with SendEvent and key delays, and check the game's rules: many online games ban automation.