AutoIt Language Reference (AutoItSetOption)

[ KiXtart  VBScript  Batch  AutoIt  HTA  PowerShell  Windows Command Lines  Other Command Line Utilities  ]


AutoItSetOption  (Function)

Syntax
AutoItSetOption ("<option>", <setting>)

Parameters
option = CaretCoordMode
Determines how coordinates are used in the caret functions:
    setting = 1 absolute screen (default)
    setting = 0 relative to active window

option = ColorMode
Sets the way colors are defined, either RGB or BGR:
    0 = Colors are defined as RGB (0xRRGGBB) (default)
    1 = Colors are defined as BGR (0xBBGGRR) (the mode used in older versions of AutoIt)

option = ExpandEnvStrings
Specifies how literal strings and percent signs are to be interepreted:
    setting = 1 expand environment variables
    setting = 0 do not expand environment variables (default)

option = FtpBinaryMode
Changes how FTP files are transferred:
    1 = Binary (default)
    0 = ASCII

option = GUICloseOnESC
When ESC is pressed on a GUI the $GUI_EVENT_CLOSE message is sent:
    1 = Send the $GUI_EVENT_CLOSE message when ESC is pressed (default).
    0 = Don't send the $GUI_EVENT_CLOSE message when ESC is pressed.

option = GUICoordMode
Alters the position of a control defined by GUICtrlSetPos:
    1 = absolute coordinates (default) note: this is still relative to the dialog box.
    0 = relative position to the start of the last control (upper left corner)
    2 = cell positionining relative to current cell. A -1 for left or top parameter don't increment the start.

option = GUIOnEventMode
Enable/disable OnEvent functions notifications.
    0 = disable (default)
    1 = enable

option = GUIResizeMode
Change default resizing for a control:
    0 = no resizing (default)
<1024 = anytype of resizing

option = MouseClickDelay
Specifies the length of the pause between mouse clicks:
    setting = number of milliseconds (default: 10)

option = MouseClickDownDelay
Specifies the length of time a click is held down before release:
    setting = number of milliseconds (default: 10)

option = MouseClickDragDelay
Specifies pause at the start and end of mouse drag actions:
    setting = number of milliseconds (default: 250)

option = MouseCoordMode
Specifies the way coordinates are used in moust functions:
    setting = 1 absolute screen (default)
    setting = 0 relative to active window

option = MustDeclareVars
If this option is used then all variables must be pre-declared with Dim, Local or Global before they can be used:
    setting = 1 variables must be pre-declared
    setting = 0 variables don't need to be pre-declared (default)

option = OnExitFunc
Sets the name of the function called when AutoIt exits:
    OnAutoItExit (default)

option = PixelCoordMode
Sets the way coordinates are used in the pixel functions:
    setting = 1 absolute screen coordinates (default)
    setting = 0 relative coords to the active window

option = RunErrorsFatal
Sets if the script should terminate with a fatal error if a Run/RunWait function fails due to bad paths/file not found/Bad login IDs:
    setting = 1 fatal error (default)
    setting = 0 silent error (@error set to 1)

option = SendAttachMode
Specifies if AutoIt attaches input threads when using then Send() function.
    setting = 0 don't attach (default)
    setting = 1 attach

option = SendCapslockMode
Specifies if AutoIt should store the state of capslock before a Send function and restore it after the operation is complete.
    setting = 0 don't store/restore
    setting = 1 store and restore (default)

option = SendKeyDelay
Alters the the length of the brief pause in between sent keystrokes.
    setting = time in milliseconds (default: 5)  

option = SendKeyDownDelay
Alters the length of time a key is held down before released during a keystroke.
    setting = time in milliseconds (default: 1)

option = TrayIconDebug
If enabled shows the current script line in the tray icon tip to help debugging.
    setting = 0 no debug information (default)
    setting = 1 show debug

option = TrayIconHide
Hides the AutoIt tray icon.
    setting = 0 show icon (default)
    setting = 1 hide icon

option = WinDetectHiddenText
Specifies if hidden window text is detected by the window matching functions.
    setting = 0 do not detect hidden text (default)
    setting = 1 detect hidden text

option = WinSearchChildren
Allows the window search routines to search child windows as well as top-level windows.
    setting = 0 snly search top-level windows (default)
    setting = 1 search top-level and child windows

option = WinTextMatchMode
Sets the method that is used to match window text during search operations.
    setting = 1 complete (slower) mode (default)
    setting = 2 quick mode (detects only dialog text, button text and the captions of some controls)

option = WinTitleMatchMode
Specifies the method that is used to match window titles during search operations.
    setting = 1 match the title from the start (default)
    setting = 2 match any substring in the title
    setting = 3 exact title match
    setting = 4 advanced mode, see Window Titles & Text (Advanced)

option = WinWaitDelay
Alters how long a script should briefly pause after a successful window-related operation.
    setting = time in milliseconds (default: 250)

Description
Changes the behavior of several AutoIt functions/parameters

Example
Hide tray icon:

AutoItSetOption("TrayIconHide",1)

Remarks
For SendAttachMode, when not attaching detecting the state of capslock/scrolllock and numlock can be unreliable under NT4. However, when you specify the mode to equal one, the Send syntax will not work and there may be problems with sending keys to "hung" windows.

For SendKeyDelay, a value of 0 does not always work. If you run into this, specify a value of 1 instead.

For the TrayIconHide option, the icon will initially appear for about 750 milliseconds.

RGB is the default ColorMode but in previous versions of AutoIt (pre 3.0.102) BGR was the default.

Also see:
WinSetState  


 
Have a correction, addition or suggestion on this? Please let us know!
Last Edited: 9/26/2005. This page has been viewed 4086 times. Unless otherwise specified, all information is (C) 2004-2007 iTripoli, Inc. All Rights Reserved.

Note: you can view this information right within ASE by right clicking any keyword and selecting "Help..."



iTripoli prides itself on providing top notch customer service

Find answers or open a ticket to ask directly, when opening a ticket we will suggest relavant articles to help you get answers as quickly and accurately as possible. Visit our support center now!

Please visit our full support center to find answers quickly or submit questions or feedback.