Tutorial by Examples

if(A_TimeIdlePhysical > 60000) { ; 60,000 milliseconds WinClose, ahk_class Chrome_WidgetWin_1 MsgBox, Google Chrome was closed due to user inactivity. } This check could be done periodically, e.g. using SetTimer.
This example inserts/sends the current day of the week's full name (e.g. Sunday) whenever Ctrl + Alt + D is pressed: ^!d::Send, %A_DDDD%
myDebt := 9000 index := RegExMatch("You owe me $42", "\$(\d+)", dollars) if(index > 0) { ; indices are usually 1-based in AHK myDebt += dollars1 MsgBox, Current debt: %myDebt% } Result: Current debt: 9042
myString := " hello, Trim()! " trimmed := Trim(myString) FileAppend, % trimmed "`n", TrimmedStrings.txt Note that Trim() will not manipulate the original string, but return a new one which should be stored or output somewhere.

Page 1 of 1