| File Input/Output | Close a file | Success := FileClose(FileObject) | FileClose := FileClose(FileOpen) | Closes a file that was previously opened. |
| String Manipulation | Substring | NewString := SubStr(String, Start, Length) | myString := "Hello, world!"newString := SubStr(myString, 7) | Extracts a substring from a larger string. |
| Replace | NewString := StrReplace(String, Old, New) | myString := "Hello, world!"newString := StrReplace(myString, "world", "John") | Replaces a specific substring with a new string. |
| Split | Array := StrSplit(String, Delimiter) | myString := "John,Doe,35"myArray := StrSplit(myString, ",")MsgBox First name: %myArray[1]% | Splits a string into an array using a specified delimiter. |
| Error Handling | Try-Catch-Finally | try {ActionThatMightThrowException} catch {ActionToHandleException} finally {ActionToExecuteRegardlessOfException} | try { FileDelete, C:\myFile.txt} catch { MsgBox, The file could not be deleted.} finally { MsgBox, The file deletion is complete.} | Allows for the handling of exceptions and execution of code regardless of whether an exception was thrown. |
| OnExit | OnExit, FunctionName | OnExit, myFuncmyFunc() { ; code to execute when the script exits} | Registers a function to be called when the script exits. |
| ErrorLevel | CommandThatMaySetErrorLevelif ErrorLevel {ActionToHandleError} | FileDelete, C:\myFile.txtif ErrorLevel { MsgBox, The file could not be deleted.} | Checks the value of the ErrorLevel variable to determine if an operation was successful. |
| Windows Automation | Window titles and classes | WinGetTitle, OutputVar, WinTitle | WinGetTitle, title, AWinGetClass, class, AMsgBox, The active window has the title "%title%" and class "%class%". | Retrieves the title and class of the active window. |
| Window activation | WinActivate, WinTitle | WinActivate, Notepad | Activates a specified window. |
| Window movement and sizing | WinMove, WinTitle, X, Y, Width, Height | `WinMove, Untitled - Notepad,, 0, 0, | |