

If unset, the standard defaults will apply (as documented on each of the following pages): AutoTrim, CoordMode, Critical, DetectHiddenText, DetectHiddenWindows, FileEncoding, ListLines, SendLevel, SendMode, SetBatchLines, SetControlDelay, SetDefaultMouseSpeed, SetFormat, SetKeyDelay, SetMouseDelay, SetRegView, SetStoreCapsLockMode, SetTitleMatchMode, SetWinDelay, StringCaseSense, and Thread. The #Persistent directive can also be used to explicitly make the script persistent.Įvery thread launched by a hotkey, hotstring, menu item, GUI event, or timer starts off fresh with the default values for the following attributes as set in the auto-execute section. A script is automatically persistent if it contains hotkeys, hotstrings, OnMessage() or GUI, and in a few other cases. Otherwise, it will stay running in an idle state, responding to events such as hotkeys, hotstrings, GUI events, custom menu items, and timers. If the script is not persistent, it will terminate after the auto-execute section has completed. Note: While the script's first hotkey/hotstring label has the same effect as return, other hotkeys and labels do not. This top portion of the script is referred to as the auto-execute section.

The Top of the Script (the Auto-execute Section)Īfter the script has been loaded, it begins executing at the top line, continuing until a Return, Exit, hotkey/hotstring label, or the physical end of the script is encountered (whichever comes first). Any syntax errors will be displayed, and they must be corrected before the script can run. During loading, the script is optimized and validated. The program loads the script into memory line by line, and each line may be up to 16,383 characters long. However, in the absence of hotkeys and hotstrings, a script will perform its commands sequentially from top to bottom the moment it is launched. A script may also contain hotkeys and hotstrings, or even consist entirely of them.


