Each tutorial below is short on purpose: one idea, one working file, one thing you can keep using afterward. Work through them in order if you are new, or jump to whichever problem you have right now.
first.ahk and open it in any text editor.#Requires AutoHotkey v2.0 on the first line.^!n::Run "notepad.exe" and save.Start from a single key, then grow the block. The writing hotkeys page in the reference walks through modifiers, multi-line blocks and context sensitivity in detail; the hotkeys page here summarizes the symbols.
^!s::
{
WinActivate "ahk_exe notepad.exe"
WinWaitActive "ahk_exe notepad.exe"
Send "Status report{Enter}"
}
Activate first, wait for the window to accept focus, then type. Skipping the wait is the single most common reason keystrokes land in the wrong place.
#Up::WinMaximize "A" #Down::WinMinimize "A" #c::WinClose "A"
Collect the phrases you retype — addresses, sign-offs, ticket templates — into one hotstring file and load it at startup. Details and options are on the scripts page.
SetTimer Remind, 1800000 ; every 30 minutes
Remind()
{
ToolTip "Stand up and stretch"
Sleep 3000
ToolTip
}
MsgBox or ToolTip at the point you suspect.Sleep before assuming the logic is wrong.When the basics feel comfortable, read the v2 guide and start reading finished code under examples.
Create a .ahk file, add #Requires AutoHotkey v2.0 and one hotkey line, save it, and double-click to run.
The script typed before the target window had focus. Activate the window, wait with WinWaitActive, then send.
Use SetTimer with a function name and an interval in milliseconds.