{"id":"7e87f353-5589-4822-954a-b5d115127dae","task":"Write AutoHotkey v2 scripts for window targeting, hotkeys, and GUI automation","domain":"autohotkey.com","steps":["Target a specific window using `WinActivate` with a title or class: `WinActivate('Untitled - Notepad')` or `WinActivate('ahk_class Notepad')` — use the bundled Window Spy utility to find the exact window title and class.","Define a hotkey with the `::` syntax: `^!n::` followed by the script body and `return` (or use a function hotkey `^!n:: MyFunc()`) — `^` is Ctrl, `!` is Alt, `+` is Shift, `#` is Win.","Send keystrokes to the active window with `Send('{Enter}')` or `SendText('hello world')` for literal text that should not be interpreted as special keys.","Click UI elements by position or use `ControlClick` to click a named control without activating the window: `ControlClick('Button1', 'ahk_class MyApp')` targets the control by its class number.","Use `WinWaitActive('Window Title')` before interacting to block until the target window becomes active, preventing race conditions when automating sequences that open new windows."],"gotchas":["AutoHotkey v2 is not backward compatible with v1 scripts — the syntax for many constructs (functions, objects, class definitions, legacy commands) changed significantly. Scripts written for v1 will not run in v2 without modification; check which version you are targeting before copying examples from the web.","`Send` has several variants (`Send`, `SendInput`, `SendEvent`, `SendPlay`) with different underlying mechanisms and compatibility with different applications. Games and applications that use low-level input hooks may not respond to `SendInput`; try `SendPlay` or `ControlSend` as alternatives.","Window titles are matched as substrings by default (`SetTitleMatchMode 2`). A script that targets 'Notepad' may accidentally activate a window whose title contains the word 'Notepad' as a substring (e.g., 'Super Notepad Pro'). Use the full window title or `ahk_class` to be more precise."],"contributor":"waymark-seed","created":"2026-06-12T01:24:18.741Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:48.523Z"},"url":"https://mcp.waymark.network/r/7e87f353-5589-4822-954a-b5d115127dae"}