Command |
Description |
{ ... } |
A pair of braces denotes a block.
Blocks are typically used with functions, Else, Loop, While-loop, and
IF-commands. |
AutoTrim |
Determines whether "Var1 = %Var2%"
statements omit spaces and tabs from the beginning and end of
Var2. |
BlockInput |
Disables or enables the user's
ability to interact with the computer via keyboard and mouse. |
Break |
Exits (terminates) a loop. Valid
inside any kind of loop. |
Click |
Clicks a mouse button at the
specified coordinates. It can also hold down a mouse button, turn the mouse
wheel, or move the mouse. |
ClipWait |
Waits until the clipboard contains
data. |
Continue |
Skips the rest of the current loop
iteration and begins a new one. Valid inside any kind of loop. |
Control |
Makes a variety of changes to a
control. |
ControlClick |
Sends a mouse button or mouse wheel
event to a control. |
ControlFocus |
Sets input focus to a given control
on a window. |
ControlGet |
Retrieves various types of
information about a control. |
ControlGetFocus |
Retrieves which control of the
target window has input focus, if any. |
ControlGetPos |
Retrieves the position and size of a
control. |
ControlGetText |
Retrieves text from a
control. |
ControlMove |
Moves or resizes a
control. |
ControlSend /
ControlSendRaw |
Sends simulated keystrokes to a
window or control. |
ControlSetText |
Changes the text of a
control. |
CoordMode |
Sets coordinate mode for various
commands to be relative to either the active window or the
screen. |
Critical |
Prevents the current thread from
being interrupted by other threads. |
DetectHiddenText |
Determines whether invisible text in
a window is "seen" for the purpose of finding the window. This affects commands
such as IfWinExist and WinActivate. |
DetectHiddenWindows |
Determines whether invisible windows
are "seen" by the script. |
DllCall() |
Calls a function inside a DLL, such
as a standard Windows API function. |
Drive |
Ejects/retracts the tray in a CD or
DVD drive, or sets a drive's volume label. |
DriveGet |
Retrieves various types of
information about the computer's drive(s). |
DriveSpaceFree |
Retrieves the free disk space of a
drive, in Megabytes. |
Edit |
Opens the current script for editing
in the associated editor. |
Else |
Specifies the command(s) to perform
if an IF-statement evaluates to FALSE. When more than one command is present,
enclose them in a block (braces). |
EnvAdd |
Sets a variable to the sum of itself
plus the given value (can also add or subtract time from a date-time value).
Synonymous with: var += value |
EnvDiv |
Sets a variable to itself divided by
the given value. Synonymous with: var /= value |
EnvGet |
Retrieves an environment
variable. |
EnvMult |
Sets a variable to itself times the
given value. Synonymous with: var *= value |
EnvSet |
Writes a value to a variable
contained in the environment. |
EnvSub |
Sets a variable to itself minus the
given value (can also compare date-time values). Synonymous with: var -=
value |
EnvUpdate |
Notifies the OS and all running
applications that environment variable(s) have changed. |
Exit |
Exits the current thread or (if the
script is not persistent and contains no hotkeys) the entire
script. |
ExitApp |
Terminates the script
unconditionally. |
FileAppend |
Writes text to the end of a file
(first creating the file, if necessary). |
FileCopy |
Copies one or more
files. |
FileCopyDir |
Copies a folder along with all its
sub-folders and files (similar to xcopy). |
FileCreateDir |
Creates a folder. |
FileCreateShortcut |
Creates a shortcut (.lnk)
file. |
FileDelete |
Deletes one or more
files. |
FileInstall |
Includes the specified file inside
the compiled version of the script. |
FileGetAttrib |
Reports whether a file or folder is
read-only, hidden, etc. |
FileGetShortcut |
Retrieves information about a
shortcut (.lnk) file, such as its target file. |
FileGetSize |
Retrieves the size of a
file. |
FileGetTime |
Retrieves the datetime stamp of a
file or folder. |
FileGetVersion |
Retrieves the version of a file.
|
FileMove |
Moves or renames one or more
files. |
FileMoveDir |
Moves a folder along with all its
sub-folders and files. It can also rename a folder. |
FileRead |
Reads a file's contents into a
variable. |
FileReadLine |
Reads the specified line from a file
and stores the text in a variable. |
FileRecycle |
Sends a file or directory to the
recycle bin, if possible. |
FileRecycleEmpty |
Empties the recycle
bin. |
FileRemoveDir |
Deletes a folder. |
FileSelectFile |
Displays a standard dialog that
allows the user to open or save file(s). |
FileSelectFolder |
Displays a standard dialog that allows the user to select
a folder.
|
FileSetAttrib |
Changes the attributes of one or
more files or folders. Wildcards are supported. |
FileSetTime |
Changes the datetime stamp of one or
more files or folders. Wildcards are supported. |
FormatTime |
Transforms a YYYYMMDDHH24MISS
timestamp into the specified date/time format. |
GetKeyState |
Checks if a keyboard key or
mouse/joystick button is down or up. Also retrieves joystick
status. |
Gosub |
Jumps to the specified label and
continues execution until Return is encountered. |
Goto |
Jumps to the specified label and
continues execution. |
GroupActivate |
Activates the next window in a
window group that was defined with GroupAdd. |
GroupAdd |
Adds a window specification to a
window group, creating the group if necessary. |
GroupClose |
Closes the active window if it was
just activated by GroupActivate or GroupDeactivate. It then activates the next
window in the series. It can also close all windows in a group.
|
GroupDeactivate |
Similar to GroupActivate except
activates the next window not in the group. |
GUI |
Creates and manages windows and
controls. Such windows can be used as data entry forms or custom user
interfaces. |
GuiControl |
Makes a variety of changes to a
control in a GUI window. |
GuiControlGet |
Retrieves various types of
information about a control in a GUI window. |
HideAutoItWin,
On|Off |
[Obsolete -- the following is
equivalent: Menu, tray, NoIcon|Icon] |
Hotkey |
Creates, modifies, enables, or
disables a hotkey while the script is running. |
if |
Specifies the command(s) to perform
if the comparison of a variable to a value evalutes to TRUE. When more than one
command is present, enclose them in a block (braces). |
if
(expression) |
Specifies the command(s) to perform
if an expression evaluates to TRUE. |
If var [not]
between |
Checks whether a variable's contents
are numerically or alphabetically between two values
(inclusive). |
If var [not]
in/contains MatchList |
Checks whether a variable's contents
match one of the items in a list. |
If var is [not]
type
|
Checks whether a variable's contents
are numeric, uppercase, etc. |
IfEqual/IfNotEqual
|
Compares a variable to a value for
equality. Synonymous with: if var = value | if var <>
value |
IfExist /
FileExist()
|
Checks for the existence of a file
or folder. |
IfGreater/IfGreaterOrEqual
|
Compares a variable to a value.
Synonymous with: if var > value | if var >= value |
IfInString / InStr()
|
Checks if a variable contains the
specified string. |
IfLess/IfLessOrEqual
|
Compares a variable to a value.
Synonymous with: if var < value | if var <= value |
IfMsgBox
|
Checks which button was pushed by
the user during the most recent MsgBox command. |
IfWinActive /
IfWinNotActive
|
Checks if the specified window
exists and is currently active (foremost). |
IfWinExist /
IfWinNotExist
|
Checks if the specified window
exists. |
ImageSearch |
Searches a region of the screen for
an image. |
IniDelete |
Deletes a value from a standard
format .ini file. |
IniRead |
Reads a value from a standard format
.ini file. |
IniWrite |
Writes a value to a standard format
.ini file. |
Input |
Waits for the user to type a string
(not supported on Windows 9x: it does nothing). |
InputBox |
Displays an input box to ask the
user to enter a string. |
KeyHistory |
Displays script info and a history
of the most recent keystrokes and mouse clicks. |
KeyWait |
Waits for a key or mouse/joystick
button to be released or pressed down. |
LeftClick |
[Obsolete -- use Click for greater
flexibility] |
LeftClickDrag |
[Obsolete -- use MouseClickDrag for
greater flexibility] |
ListHotkeys |
Displays the hotkeys in use by the
current script, whether their subroutines are currently running, and whether or
not they use the keyboard or mouse hook. |
ListLines |
Displays the script lines most
recently executed. |
ListVars |
Displays the script's variables:
their names and current contents. |
Loop (normal)
|
Perform a series of commands
repeatedly: either the specified number of times or until break is encountered.
|
Loop (files &
folders) |
Retrieves the specified files or
folders, one at a time. |
Loop (parse a
string) |
Retrieves substrings (fields) from a
string, one at a time. |
Loop (read file
contents) |
Retrieves the lines in a text file,
one at a time (performs better than FileReadLine). |
Loop
(registry) |
Retrieves the contents of the
specified registry subkey, one item at a time. |
Menu |
Creates, deletes, modifies and
displays menus and menu items. Changes the tray icon and its tooltip. Controls
whether the main window of a compiled script can be opened. |
MouseClick |
Clicks or holds down a mouse button,
or turns the mouse wheel. NOTE: The Click command is generally more flexible and
easier to use. |
MouseClickDrag |
Clicks and holds the specified mouse
button, moves the mouse to the destination coordinates, then releases the
button. |
MouseGetPos |
Retrieves the current position of
the mouse cursor, and optionally which window and control it is hovering
over. |
MouseMove |
Moves the mouse
cursor. |
MsgBox |
Displays the specified text in a
small window containing one or more buttons (such as Yes and
No). |
OnExit |
Specifies a subroutine to run
automatically when the script exits. |
OnMessage() |
Specifies a function to call
automatically when the script receives the specified message. |
OutputDebug |
Sends a string to the debugger (if
any) for display. |
Pause |
Pauses the script's current
thread. |
PixelGetColor |
Retrieves the color of the pixel at
the specified x,y coordinates. |
PixelSearch |
Searches a region of the screen for
a pixel of the specified color. |
PostMessage |
Places a message in the message
queue of a window or control. |
Process |
Performs one of the following
operations on a process: checks if it exists; changes its priority; closes it;
waits for it to close. |
Progress |
Creates or updates a window
containing a progress bar. |
Random |
Generates a pseudo-random
number. |
RegExMatch() |
Determines whether a string contains
a pattern (regular expression). |
RegExReplace() |
Replaces occurrences of a pattern
(regular expression) inside a string. |
RegDelete |
Deletes a subkey or value from the
registry. |
RegRead |
Reads a value from the
registry. |
RegWrite |
Writes a value to the
registry. |
RegisterCallback() |
Creates a machine-code address that
when called, redirects the call to a function in the script. |
Reload |
Replaces the currently running
instance of the script with a new one. |
Repeat…EndRepeat
|
[Obsolete -- use Loop for greater
flexibility] |
Return |
Returns from a subroutine to which
execution had previously jumped via function-call, Gosub, Hotkey activation,
GroupActivate, or other means. |
RightClick |
[Obsolete -- use Click for greater
flexibility] |
RightClickDrag |
[Obsolete -- use MouseClickDrag for
greater flexibility] |
Run |
Runs an external
program. |
RunAs |
Specifies a set of user credentials
to use for all subsequent uses of Run and RunWait. Requires Windows 2000/XP or
later. |
RunWait |
Runs an external program and waits
until it finishes. |
Send / SendRaw /
SendInput / SendPlay |
Sends simulated keystrokes and mouse
clicks to the active window. |
SendMessage |
Sends a message to a window or
control and waits for acknowledgement. |
SendMode |
Makes Send synonymous with SendInput
or SendPlay rather than the default (SendEvent). Also makes Click and
MouseMove/Click/Drag use the specified method. |
SetBatchLines |
Determines how fast a script will
run (affects CPU utilization). |
SetCapslockState |
Sets the state of the Capslock key.
Can also force the key to stay on or off. |
SetControlDelay |
Sets the delay that will occur after
each control-modifying command. |
SetDefaultMouseSpeed |
Sets the mouse speed that will be
used if unspecified in Click and MouseMove/Click/Drag. |
SetEnv (Var =
Value) |
Assigns the specified value to a
variable. |
SetFormat |
Sets the format of integers and
floating point numbers generated by math operations. |
SetKeyDelay |
Sets the delay that will occur after
each keystroke sent by Send or ControlSend. |
SetMouseDelay |
Sets the delay that will occur after
each mouse movement or click. |
SetNumlockState |
Sets the state of the Numlock key.
Can also force the key to stay on or off. |
SetScrollLockState |
Sets the state of the Scrolllock
key. Can also force the key to stay on or off. |
SetStoreCapslockMode
|
Whether to restore the state of
CapsLock after a Send. |
SetTimer |
Causes a subroutine to be launched
automatically and repeatedly at a specified time interval. |
SetTitleMatchMode |
Sets the matching behavior of the
WinTitle parameter in commands such as WinWait. |
SetWinDelay |
Sets the delay that will occur after
each windowing command, such as WinActivate. |
SetWorkingDir |
Changes the script's current working
directory. |
Shutdown |
Shuts down, restarts, or logs off
the system. |
Sleep |
Waits the specified amount of time
before continuing. |
Sort |
Arranges a variable's contents in
alphabetical, numerical, or random order (optionally removing
duplicates). |
SoundBeep |
Emits a tone from the PC
speaker. |
SoundGet |
Retrieves various settings from a
sound device (master mute, master volume, etc.) |
SoundGetWaveVolume |
Retrieves the wave output volume
from a sound device. |
SoundPlay |
Plays a sound, video, or other
supported file type. |
SoundSet |
Changes various settings of a sound
device (master mute, master volume, etc.) |
SoundSetWaveVolume |
Changes the wave output volume for a
sound device. |
SplashImage |
Creates or updates a window
containing a JPG, GIF, or BMP image. |
SplashTextOn |
Creates a customizable text popup
window. |
SplashTextOff |
Closes the above window.
|
SplitPath |
Separates a file name or URL into
its name, directory, extension, and drive. |
StatusBarGetText |
Retrieves the text from a standard
status bar control. |
StatusBarWait |
Waits until a window's status bar
contains the specified string. |
StringCaseSense |
Determines whether string
comparisons are case sensitive (default is "not case sensitive").
|
StringGetPos /
InStr() |
Retrieves the position of the
specified substring within a string. |
StringLeft |
Retrieves a number of characters
from the left-hand side of a string. |
StringLen / StrLen()
|
Retrieves the count of how many
characters are in a string. |
StringLower |
Converts a string to
lowercase. |
StringMid / SubStr()
|
Retrieves one or more characters
from the specified position in a string. |
StringReplace |
Replaces the specified substring
with a new string. |
StringRight |
Retrieves a number of characters
from the right-hand side of a string. |
StringSplit |
Separates a string into an array of
substrings using the specified delimiters. |
StringTrimLeft |
Removes a number of characters from
the left-hand side of a string. |
StringTrimRight |
Removes a number of characters from
the right-hand side of a string. |
StringUpper |
Converts a string to
uppercase. |
Suspend |
Disables or enables all or selected
hotkeys and hotstrings. |
SysGet |
Retrieves screen resolution,
multi-monitor info, dimensions of system objects, and other system
properties. |
Thread |
Sets the priority or
interruptibility of threads. It can also temporarily disable all
timers. |
ToolTip |
Creates an always-on-top window
anywhere on the screen. |
Transform |
Performs miscellaneous math
functions, bitwise operations, and tasks such as ASCII/Unicode
conversion. |
TrayTip |
Creates a balloon message window
near the tray icon. Requires Windows 2000/XP or later. |
UrlDownloadToFile |
Downloads a file from the Internet.
|
Var = value
|
Assigns the specified value to a
variable. |
Var := expression
|
Evaluates an expression and stores
the result in a variable. |
VarSetCapacity() |
Enlarges a variable's holding
capacity or frees its memory. Normally, this is necessary only for unusual
circumstances such as DllCall. |
While-loop |
Performs a series of commands
repeatedly until the specified expression evaluates to false. |
WinActivate |
Activates the specified window
(makes it foremost). |
WinActivateBottom |
Same as WinActivate except that it
activates the bottommost (least recently active) matching window rather than the
topmost. |
WinClose |
Closes the specified
window. |
WinGetActiveStats |
Combines the functions of
WinGetActiveTitle and WinGetPos into one command. |
WinGetActiveTitle |
Retrieves the title of the active
window. |
WinGetClass |
Retrieves the specified window's
class name. |
WinGet |
Retrieves the specified window's
unique ID, process ID, process name, or a list of its controls. It can also
retrieve a list of all windows matching the specified criteria. |
WinGetPos |
Retrieves the position and size of
the specified window. |
WinGetText |
Retrieves the text from the
specified window. |
WinGetTitle |
Retrieves the title of the specified
window. |
WinHide |
Hides the specified window.
|
WinKill |
Forces the specified window to
close. |
WinMaximize |
Enlarges the specified window to its
maximum size. |
WinMenuSelectItem |
Invokes a menu item from the menu
bar of the specified window. |
WinMinimize |
Collapses the specified window into
a button on the task bar. |
WinMinimizeAll |
Minimizes all
windows. |
WinMinimizeAllUndo |
Reverses the effect of a previous
WinMinimizeAll. |
WinMove |
Changes the position and/or size of
the specified window. |
WinRestore |
Unminimizes or unmaximizes the
specified window if it is minimized or maximized. |
WinSet |
Makes a variety of changes to the
specified window, such as "always on top" and transparency. |
WinSetTitle |
Changes the title of the specified
window. |
WinShow |
Unhides the specified
window. |
WinWait |
Waits until the specified window
exists. |
WinWaitActive |
Waits until the specified window is
active. |
WinWaitClose |
Waits until the specified window
does not exist. |
WinWaitNotActive |
Waits until the specified window is
not active. |
#AllowSameLineComments |
Only for AutoIt v2 (.aut) scripts:
Allows a comment to appear on the same line as a command. |
#ClipboardTimeout |
Changes how long the script keeps
trying to access the clipboard when the first attempt fails. |
#CommentFlag |
Changes the script's comment symbol
from semicolon to some other string. |
#ErrorStdOut |
Sends any syntax error that prevents
a script from launching to stdout rather than displaying a
dialog. |
#EscapeChar |
Changes the script's escape
character (for example: backslash vs. accent). |
#HotkeyInterval |
Along with #MaxHotkeysPerInterval,
specifies the rate of hotkey activations beyond which a warning dialog will be
displayed. |
#HotkeyModifierTimeout |
Affects the behavior of hotkey
modifiers: CTRL, ALT, WIN, and SHIFT. |
#Hotstring |
Changes hotstring options or ending
characters. |
#IfWinActive /
#IfWinExist |
Creates context-sensitive hotkeys
and hotstrings. Such hotkeys perform a different action (or none at all)
depending on the type of window that is active or exists. |
#Include |
Causes the script to behave as
though the specified file's contents are present at this exact
position. |
#InstallKeybdHook |
Forces the unconditional
installation of the keyboard hook. |
#InstallMouseHook |
Forces the unconditional
installation of the mouse hook. |
#KeyHistory |
Sets the maximum number of keyboard
and mouse events displayed by the KeyHistory window. You can set it to 0 to
disable key history. |
#MaxHotkeysPerInterval |
Along with #HotkeyInterval,
specifies the rate of hotkey activations beyond which a warning dialog will be
displayed. |
#MaxMem |
Sets the maximum capacity of each
variable to the specified number of megabytes. |
#MaxThreads |
Sets the maximum number of
simultaneous threads. |
#MaxThreadsBuffer |
Causes some or all hotkeys to buffer
rather than ignore keypresses when their #MaxThreadsPerHotkey limit has been
reached. |
#MaxThreadsPerHotkey |
Sets the maximum number of
simultaneous threads per hotkey or hotstring. |
#NoEnv |
Avoids checking empty variables to
see if they are environment variables (recommended for all new
scripts). |
#NoTrayIcon |
Disables the showing of a tray
icon. |
#Persistent |
Keeps a script permanently running
(that is, until the user closes it or ExitApp is encountered). |
#SingleInstance |
Determines whether a script is
allowed to run again when it is already running. |
#UseHook |
Forces the use of the hook to
implement all or some keyboard hotkeys. |
#WinActivateForce |
Skips the gentle method of
activating a window and goes straight to the forceful method.
|