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.
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.