AHK v2 Wizard-AHK v2 script generator
AI-powered AutoHotkey v2 scripting.

Expert AutoHotkey v2 Assistant
Can you create an AHK script to automate my emails?
How do I write an AHK script for custom hotkeys?
I need an AHK script to organize my files.
What's the best way to create a GUI in AHK?
Get Embed Code
AHK v2 Wizard — purpose-built AutoHotkey v2 expert
AHK v2 Wizard is a specialized assistant focused on designing, writing, and explaining AutoHotkey v2 (AHK v2) scripts. Its core job is to translate plain-language workflow needs into clean, idiomatic, well-commented AHK v2 code. Design goals: (1) correctness in v2 syntax and APIs; (2) readability with clear comments and naming; (3) practical ergonomics (shortcuts that feel natural, guardrails for destructive actions); (4) portability across typical Windows setups; (5) stepwise problem-solving—plan the approach, implement, annotate, and test/iterate mentally. It helps you: (a) generate new scripts from scratch; (b) refactor or debug existing ones (including v1 → v2 migration); (c) build small GUIs to streamline tasks; (d) automate keystrokes, windows, files, and simple system tasks. It does not execute scripts on your machine; instead, it provides complete code with usage notes so you can run and adjust locally. Illustrative scenarios: • You say: "When I press Win+Q, toggle Notepad and paste a timestamp." → It returns a ready-to-run hotkey with comments and safe waits. • You paste a v1 script that broke after upgrading to v2. → It rewrites it in v2 style, explains differences, and adds guardrails. • You need a tiny helper window that inserts canned responses. → ItAHK v2 Wizard overview drafts a compact GUI with event handlers and sensible defaults.
What AHK v2 Wizard does (with concrete applications)
On-demand AHK v2 script generation from plain requirements
Example
#Requires AutoHotkey v2.0\n#SingleInstance Force\n\n; Win+Q → Toggle Notepad, then type an ISO timestamp\n#q:: {\n exe := \"ahk_exe notepad.exe\"\n if WinExist(exe) {\n WinActivate exe\n } else {\n Run \"notepad.exe\"\n WinWaitActive exe, , 3 ; wait up to 3s\n }\n ; Type a timestamp without triggering hotkeys\n ts := FormatTime(A_Now, \"yyyy-MM-dd'T'HH:mm:ss\")\n SendText ts\n}\n\n; Ctrl+Alt+J → Insert a JSON skeleton as literal text\n^!j:: {\n SendText \"{\\\"name\\\": \\\"\\\", \\\"email\\\": \\\"\\\", \\\"notes\\\": \\\"\\\"}\"\n}
Scenario
A support lead wants one key to bring Notepad forward (or launch it) and stamp the current time for quick jot-notes. Another hotkey inserts a JSON snippet for logging. The wizard converts that plain ask into a robust script with proper waits and uses SendText so no special characters are misinterpreted.
Troubleshooting, refactoring, and v1 → v2 migration (with explanation)
Example
; Original (v1-style) snippet provided by user:\n; ::addr::123 Main St{Enter}New York, NY 10001\n; ^!n::\n; IfWinExist, Untitled - Notepad\n; {\n; WinActivate\n; } else {\n; Run, notepad.exe\n; WinWaitActive, Untitled - Notepad\n; }\n; return\n\n; Rewritten in idiomatic v2 with comments\n#Requires AutoHotkey v2.0\n#SingleInstance Force\n\n::addr:: {\n ; Hotstring block form in v2; use `n for newline\n SendText \"123 Main St`nNew York, NY 10001\"\n}\n\n^!n:: {\n exe := \"ahk_exe notepad.exe\"\n if WinExist(exe) {\n WinActivate exe\n } else {\n Run \"notepad.exe\"\n WinWaitActive exe, , 3\n }\n}\n\n; Notes: v2 uses function-call style (WinExist/WinActivate/Run).\n; Hotstrings can use block syntax for clarity; SendText avoids special key parsing.
Scenario
A team upgraded to AHK v2 and several legacy v1 scripts broke (hotstrings stopped firing, window commands changed). The wizard rewrites the code in v2 style, points out syntax differences, and adds comments so the team understands what changed and why.
Rapid GUI prototyping for everyday workflows
Example
#Requires AutoHotkey v2.0\n#SingleInstance Force\n\n; A tiny \"Ticket Helper\" GUI that inserts canned responses\napp := Gui(, \"Ticket Helper\")\napp.Add(\"Text\",, \"Customer Email:\")\nemail := app.Add(\"Edit\", \"w280 vEmail\")\napp.Add(\"Text\",, \"Template:\")\ntpl := app.Add(\"DropDownList\", \"vTpl w280\", [\"Welcome\", \"Refund\", \"Follow-up\"])\nins := app.Add(\"Button\", \"Default w120\", \"Insert into current app\")\nins.OnEvent(\"Click\", InsertTemplate)\napp.Show()\n\nInsertTemplate(*) {\n global tpl\n txt := tpl.Text\n block := (txt = \"Welcome\") ? \"Hi there, and welcome!\"\n : (txt = \"Refund\") ? \"We\'re processing your refund within 3–5 business days.\"\n : \"Just following up on your request—let us know if you need anything else.\"\n ; Paste as literal text into whatever window is active\n SendText block\n}
Scenario
A helpdesk agent needs quick, consistent responses across multiple apps (Outlook, web CRM). The wizard designs a minimal GUI with a dropdown of templates and a single button that inserts the selected text into the active window, avoiding app-specific integrations while improving speed and consistency.
Who benefits most from AHK v2 Wizard
Operational power users (analysts, coordinators, support/sales ops, researchers)
They live in multiple desktop apps all day and repeat lots of click/type/format actions. The wizard turns those routines into hotkeys, hotstrings, and small GUIs—reducing context switching and typos. Examples: massaging copied data before pasting, templating emails/notes, filing windows to known layouts, timestamping logs, one-key app launch/activation, and making short, reliable task macros with waits and fallbacks.
Developers, QA, and IT admins (including teams migrating from AHK v1)
They need precise, maintainable automation and quick tooling. The wizard provides idiomatic v2 code, explains API choices, and adds guardrails. Typical wins: building reproducible UI test keystrokes, scaffolding internal utilities, replacing brittle send-keys with window-targeted actions, refactoring legacy scripts to v2 with comments, and creating cockpit GUIs for admin tasks without heavyweight tooling.
How to use AHK v2 Wizard
Start here
Visit aichatonline.org for a free trial without login, also no need for ChatGPT Plus.
Prepare your environment
Install AutoHotkey v2 on Windows (10/11 recommended). Know where to save .ahk files and how to run them. Keep target app names/window titles handy (use Window Spy from AHK). If you plan COM or UI automation (e.g., Excel), ensure the apps are installed.
Describe your goal precisely
Explain what you want automated (hotkeys, text expansion, window control, GUI, file ops). Specify hotkeys, scope (active window vs global), timing, error handling, and app names. Provide examples of input/output and edge cases. State: “AutoHotkey v2 code, please.”
Generate, save, and test
Paste the code into a text editor, save as MyScript.ahk (UTF-8). Include #Requires AutoHotkey v2.0. Double‑click to run; use the tray icon to pause/exit. Debug with MsgBox/ToolTip, ListHotkeys(), and by narrowing SetTitleMatchMode or using ControlSend/ControlClick.
Iterate and optimize
Ask for refinements: betterHow to use AHK v2 window targeting, fallbacks, timeouts, comments, and GUI status. Replace Send with control-level actions where possible. Add toggles, logs, and hotkey conflict checks. For convenience, place a shortcut in shell:startup to load on boot.
Try other advanced and practical GPTs
Crossword Generator
AI-powered crosswords, customized and printable.

Enbo Lite: Your Personal Entrepreneurship Mentor
AI-powered mentor to start and scale

CISSP Study Strategy Guide
AI-powered CISSP coach for strategy, practice, and managerial thinking.

IoT (Internet of Things) Mentor
AI-powered solutions for IoT development

Git Expert ㆍGitHub & GitLabㆍ
AI-powered Git expert for GitHub & GitLab

Math Expert
AI-powered, step-by-step math solutions.

Blog Post / Article Image Generator + Alt Text
AI-driven images with SEO-friendly alt text.

cupcake v0 game 2: are you smarter than a degen
AI-powered trivia game for knowledge seekers

Veeam Backup Expert Helper Bot
AI-powered Veeam Backup Helper Bot

Translate GPT (Chinese to English Translation)
AI-powered Chinese→English, faithful and fluent.

Convo-AI
AI-powered assistant for creative tasks.

Linear Algebra
AI-powered linear algebra tutor and solver

- Data Entry
- Text Expansion
- Window Management
- File Automation
- Clipboard Tools
AHK v2 Wizard — Detailed Q&A
What exactly does AHK v2 Wizard do?
It converts your plain-English requests into clean, well‑commented AutoHotkey v2 scripts. It can design hotkeys, automate keystrokes and windows, create small GUIs, process files/clipboard text, and explain how each part works. It also helps debug scripts, suggest safer control‑based actions, and adapt code to your specific apps.
How do I run the scripts you generate?
Install AutoHotkey v2, paste the code into a new file, save as .ahk, and double‑click to run. Include #Requires AutoHotkey v2.0 at the top. Use the tray icon to pause or exit. If something doesn’t fire, verify hotkey availability, window titles (Window Spy), and try ControlSend/ControlClick instead of Send for reliability.
Can you automate specific apps like Excel, browsers, or chat tools?
Yes. Common patterns include COM for Excel (e.g., creating/reading cells), ControlSend for chat apps so keystrokes don’t steal focus, and WinActivate/WinWait/WinExist for window sequencing. For browsers or UIs that resist direct control, you can mix precise window/control targeting with timing, image/UI automation fallbacks, and robust error handling.
How do I make my request so the script is robust and maintainable?
Provide app names, exact window titles/classNN when possible, sample inputs/outputs, required hotkeys, and performance constraints (delays, timeouts). Ask for comments, modular functions, error handling (try/catch), and feature toggles. Mention environment (display scaling, admin rights) and whether the script must run minimized or without stealing focus.
Are there limitations or safety considerations I should know?
Avoid automations that violate app policies (e.g., anti‑cheat in games). Prefer control‑level actions over blind Send for stability. Use short, bounded loops with timeouts, and log failures. Test with non‑destructive data first. If elevated privileges are needed, run the script as admin and clearly label any actions that modify files or system settings.