What is AutoIt Script Editor
[Main] [Next]

AutoIt Script Editor is designed to assist in the creation of AutoIt scripts for use with AutoIt by Jonathan Bennett. The Script Editor is intuitive enough to provide the user with required parameters for each script command available, stores a list of variables and routines used by each script, and can be tested from within the editor.
Anyone using AutoIt for automated installations needs this editor to help build scripts faster then ever before. You no longer need to know all the syntax for each command because the editor does it for you.

Version 2.51 of the Script Editor supports AutoIt version 2.51.

AutoIt Script Editor is developed by Lee Boswell of the LKei Design Group. Visit our website to check out other products and services available from LKei.(www.LKei.com)

AutoIt is developed by Jonathan Bennett and can be downloaded from his website at AutoIt homepage


Customer Support
[Previous] [Main] [Next]

While LKei Design Group is not responsible for damages or problems to a user's computer by this software, we do want to provide reasonable assitance in the use of the Script Editor.

Questions, comments and suggestions can be addressed to Lee Boswell and LeeBoswell@hotmail.com.

A moderate knowledgebase and FAQ listing can also be viewed at LKei's home site. (www.LKei.com)


License Agreement

IMPORTANT-This is a legal agreement between you (either an individual or an entity) and LKei Design Group. By opening and/or using this software you acknowledge that you have read this license agreement, understand it, and agree to be bound by its terms.You further agree that it is the full and complete agreement between us. If you do not agree to the terms of this agreement, you must cease using this product immediately.

LKei Design Group Software License Agreement

GRANT OF LICENSE. This License Agreement permits you the use of the enclosed LKei Design Group software program (AutoIt Script Editor). The SOFTWARE is in "use" on a computer when it is loaded into temporary memory (i.e. RAM) or installed into permanent memory (e.g. hard disk, CD-ROM, or other storage device) of that computer.

COPYRIGHT. The SOFTWARE is owned by LKei Design Group and is protected by United States copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE like any other copyrighted material (e.g. a book or musical recording) except that you may either (a) make one copy of the SOFTWARE solely for backup or archival purposes, or (b) transfer the SOFTWARE to a single hard disk provided you keep the original solely for backup or archival purposes. You may not copy the written materials accompanying the SOFTWARE.

LIMITED WARRANTY. This program is provided "as is" without any warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the SOFTWARE is with you, the licensee. Should the SOFTWARE prove defective, you assume the risk and liability for the entire cost of all necessary repair, service, or correction. Some states/jurisdictions do not allow the exclusion of implied warranties, so the above exclusion may not apply to you. This warranty gives you specific legal rights, and you may have other rights which vary from state/jurisdiction to state/jurisdiction.

LKei Design Group does not warranty the functions contained in the SOFTWARE will meet your requirements, or that the operation of the SOFTWARE will be error-free or uninterrupted.

NO LIABILITY FOR CONSEQUENTIAL DAMAGES. To the maximum extent permitted by applicable law, in no event shall LKei Design Group be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use or inability to use this LKei Design Group product, even if LKei Design Group has been advised of the possibility of such damages or for any claim by any other party. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.


Feature List

The AutoIt Script Editor has many features that make building scripts quick and easy. Without an extended knowledge of the syntax language you can build scripts within minutes.

Below is a list of the primary features of the Script Editor:

· | Muliple scripts can be opened at one time.
· | Drag and drop between scripts.
· | List of all supported commands listed for easy selection.
· | Popup dialog box for required parameters for all commands.
· | Favorites List to store most commonly used script lines.
· | Routine and Variable List of all routines and variables used in the script.
· | Drag and drop capablity to rearrange lines of script.
· | Drag and drop capability to add commands to desired location in the script.
· | Intuitive editor inserts double-backslashes for filenames and directories.
· | Manual edit feature allows a user to make changes to a line of script manually.
· | Script Test feature allows the user to launch the script from within the editor for quick testing.
· | Convenient link to the Aut2Exe program to convert the script to an executable from within the editor.
· | Preferences allow the user to cusotmize the look and feel of the editor window.
· | Last used script can be set to load upon startup.
· | Favorites List and Routine/Varible List are dockable.
· | Link to open the current script in Notepad. (for those who may still want to)
· | Print feature makes it easy to print out your scripts.
· | New template feature makes starting a script easier. Select a predesigned template and your on your way


AutoIt Script Editor Version History

12/13/00 Version 2.51a
· | Corrected problem with Command form not allowing Run command to be entered.

12/06/00 Version 2.51
· | Added Wise Update feature to check on the web to see if a new version is available.
· | Added support for AutoIt 2.5 which includes 9 new commands (StringLeft, StringRight, StirngMid, StringLen, StringTrimLeft, StringTrimRight, StringReplace, StringCaseSense and Random)
· | Fixed a bug with the Edit Command when you want to edit a command that has no parameters.
· | If no file was last accessed then a new script opens by default.
· | Corrected some focus controls that were not functional on the Command form.
· | Corrected a bug that occurred when editing a command that had "On" or "Off" as a parameter (i.e. Break, On).
11/09/00 Version 2.5
· | Added support for AutoIt 2.5 which included 4 new commands (IfGreater, IfGreaterOrEqual, IfLess and IfLessOrEqual)
· | Fixed a bug with the background colors showing up as black in the command window and script window.
· | Jumped version number up to 2.5 to make it easier to determine which version of AutoIt the editor supports

08/08/00 Version 2.31
· | Fixed a bug with the RegRead and RegWrite commands. (When editing the commands an error was produced)

07/24/00 Version 2.3
· | Added support for AutoIt 2.42 which includes then following new commands:
IniDelete, RegDelete, BlockInput, FileAppend, FileReadLine

05/08/00 Version 2.23
· | Fixed a bug with the Variables List in the Preferences dialog box
· | Added a menu choice to add and delete Variables to the current and all open scripts
· | Added a menu choice to run AutoIt Reveal Mode
· | Fixed a bug that occurred when you saved a new script and the name was not updated in the Window menu

04/28/00 Version 2.2
· | Fixed a bug with the opening of the last accessed scripts.
· | The Save Editor position and size was not maximizing the window properly
· | Corrected a problem with the Add Backslash feature
· | Added the curent script Line Number to the status bar and a "Go to Line Number" menu item.
· | Fixed a bug with the Save As feature.
· | Corrected a problem when changing the Script Window Font Color.
· | Added the "Open in Notepad" feature to the Tools menu *Was removed in Version 2 and added back after much request
· | Added a "Refresh Script from File" item in the Edit menu which will reload the script form the file. This was added so that if you are working on a script and then use the "Open in Notepad" featue and make changes to the script, you can select "Refresh script form file" to relead the script in the window.
· | Revamped the Find and Replace options

04/12/00 Version 2.1
· | Fixed a bug with the loading of background color selections from the Registry
· | Fixed a bug with the send command
· | Fixed a bug with the Variables list not updating properly

03/15/00 Version 2.0
· | Support for AutoIt version 2.41
· | New version is MDI (Multiple Document Interface) Application that allows multiple scripts to be opened at one time.
· | Windows 2000 menu and toolbars with most recently used capabilities to hide unused items
· | Drag and Drop support between scripts
· | Additional Routine and Variable support
· | Favorites List now integrated into the toolbar and menu
· | Editor colors and font can be customized
· | Script can be saved as a template for new scripts. All new scripts would contain lines of code contained in the template.
· | Find / Find and Replace capability added for locating strings in your script.
· | AutoSave feature can save your current scripts at user defined intervals
· | Script Builder feature allows a user to build a script will running an install program - Coming soon!!

02/01/00 Version 1.33
· | Fixed bug with the SplashTextOn command ("Cannot focus on a disabled window" message)
· | Added some Shortcut commands to a few features. i.e. The delete key will perform a Delete Command, and Insert will Add a Command.
· | When using the Send command a second backslash is added when '\' is pressed (only if option is checked in the Preferences).
· | When using the Send command you can now select an entry in the key list and when new keys are pressed they are inserted rather than always being added to the end of the list.
· | Fixed a bug with the Routine list.
01/13/00 Version 1.3
· | Fixed bug with the ading of a double-backslash for filenames, directories and before literal characters
· | Added ability to change the command selected form the Command form. (great for editing a line when you edit the command by changing it to a totally different command.
· | Changed URL links to reflect HiddenSoft's new website.
01/04/00 Version 1.22
· | Minor bug fix with the Test Script feature
· | Code changes to better handle variable and routine handling

12/15/99 Version 1.2
· | Added support for AutoIt version 2.32
· | Implemented the Aut2Exe Wizard for use with the Aut2Exe program
· | Corrected minor bugs with the Command Dialog box
· | Added the "Manual Add Command" feature
· | Added Online Help

11/23/99 Version 1.1
· | Added support for AutoIt version 2.23
· | Added Favorite List for saving common command lines
· | Added Routine and Variable Listing
· | Corrected minor bugs with the Send Command

11/08/99 Version 1.0
· | First initial release
· | See Feature List for complete listing of Script Editor features.


AutoIt Version History

03/12/2000 - v2.51
· | Installation routine changed to use Microsoft Windows Installer.
· | Added commands StringLeft, StringRight, StringMid, StringLen, StringTrimLeft, StringTrimRight, IfInString, IfNotInString, StringReplace.
· | String comparisons (IfEqual, IfNotEqual, IfInString, IfNotInString, StringReplace) can have case sensitivity controlled by the StringCaseSense command.
· | Added Random number command.
· | Fixed bug with MsgBox and InputBox under NT4 (as a result the AutoIt window will be visible in the taskbar during these commands).
· | Fixed ADLIB section so that Gosub and Goto commands will work correctly.

07/11/2000 - v2.5
· | Fixed access rights with RegRead, RegWrite and RegDelete commands for non-administrator use under Windows NT.
· | Added commands IfLess, IfLessOrEqual, IfGreater, IfGreaterOrEqual.
· | Reveal mode includes the dimensions of the active window.

17/6/2000 - v2.42
· | Added IniDelete, RegDelete, commands.
· | Added the BlockInput command to disable mouse and keyboard input. (N.B. only works satisfactorily under Win2000/NT4 SP6 - best I could do I'm afraid)
· | The "/p" is now NOT case sensitive for command line parameters.
· | The WinWait routines' "Timeout" is now accurate.
· | Added simple file routines FileAppend and FileReadLine.
· | If you use the {CTRLDOWN}, {SHIFTDOWN} or {ALTDOWN} keys, the keys will be left "down" unless specified otherwise with the {CTRLUP}, {SHIFTUP} or {ALTUP} keys (even after the end of a line in the script). Use these keys wisely :)

11/02/2000 - v2.41
· | Bug with RegWrite fixed.
09/02/2000 - v2.4
· | Problems with variables containing commas fixed.
· | Lots of variables added to access times, dates, current script path, OS (NT or 9x).
· | Can pause and resume script execution by right-clicking on the taskbar icon.
· | SIMPLE registry read/write functions added for REG_SZ and REG_DWORD types.
Fixed a bug with command line parameters and quotes.
20/12/99 - v2.32
· | Some quite brutal optimizing applied, bringing the executable sizes down by 12k.
· | Aut2Exe remembers the last directory used for the script, executable and icon.
Can specify command line parameters with spaces by using quotes ("....").
12/12/99 - v2.31
· | Maximum script line length increased to 1024 characters (extra characters are ignored).
· | Memory usage when running scripts reduced by a factor of 12! (Not that I ever had any complaints :) )
10/12/99 - v2.3
· | Various bugs with ENV variables fixed.
· | Now sends correctly to DOS (I hope :) ).
· | Optional parameter added to InputBox for masking input.
· | Command line parameters can be passed to the script.
· | Now supports user-defined icons when compiling a script to an .exe.
· | MouseGetPos and MouseMove commands added.
· | Not using ASPack anymore, although feel free to use it or any other EXE compression utility on AutoIt yourself (http://www.aspack.com).
25/11/99 - v2.23
· | WinActivate tweaked for Win2000 RC2.
· | Shutdown command added.
· | WinKill command added.
23/11/99 - v2.22
· | The variable %CLIPBOARD% contains the textual contents of the clipboard.
· | Can now paste text from AutoIt to the clipboard.
· | INI File reading and writing added with IniRead and IniWrite.
20/11/99 - v2.21
· | Can now Send decimal ASCII codes, like when using using the ALT key and the numeric keypad (e.g. ALT+65 = 'A'). Very useful for sending characters that don't usually work (e.g. '~' on an Italian keyboard)
18/11/99 - v2.2
· | Can now Run programs as either hidden, maximized or minimized (great for avoiding black screens when executing DOS commands)
· | RunWait will put a program's return code in %ERRORLEVEL%
· | The WinWait group of functions can be set to timeout after a period of time (%ERRORLEVEL% can be checked to see if the function timed out or not)
· | WinShow command added (previously, there was no easy way to "undo" a WinHide!!!!)
16/09/99 - v2.11
· | Fixed bug in which ENV variables were not expanded under the "Adlib" section.
· | Installation recreated under Win98 to resolve some setup problems.
11/09/99 - v2.1
· | Aut2Exe Script Converter added to installation.
· | Internal bug in Run and RunWait fixed.
· | Added keys {CTRLUP}, {CTRLDOWN}, {SHIFTUP}, {SHIFTDOWN}, {ALTUP}, {ALTDOWN}.
28/08/99 - v2.03
· | AutoIt2.exe and AutoItX.dll now packed with ASPack reducing the executable size.
· | Changed SplashTextOn command. You no longer have to do SplashTextOff before doing a second SplashTextOn.
· | Added simple variable EnvAdd and EnvSub commands.
· | "default" can be used in place of Width and Height in the WinMove command.
· | Added commands LeftClickDrag and RightClickDrag.
26/08/99 - v2.02
· | Changes to some internal timings.
· | Made the splash windows like a little less "win 3.1 - ish".
· | Added AdlibOn and AdlibOff commands.
· | Changed internal handling of the ADLIB section.
18/08/99 - v2.01
· | Fixed Send command with multiple modifiers (i.e. CTRL+SHIFT+key, CTRL+ALT+key).
16/08/99 - v2.0
NB. Some changes mean that old AutoIt scripts may need to be modified slightly - Please re-read the documentation carefully if you are upgrading! Hence the jump from v1.8 to v2.0 - SORRY, but things needed changing to ease implementation of new commands that have been requested. I personally use v1.8 for old scripts and v2.0 for any new scripts I write.
· | Can now send most keystrokes to DOS windows - Finally!
· | Changed the way in which '\', ',' and '%' are treated - CAREFUL!
· | Changed Run and RunWait commands. Comma ',' now delimits working directory. (therefore '*' is now valid - for wildcards, etc.)
· | Added numerous keys that can be sent including WinApps key.
· | AutoIt window shows line number and line of script during execution.
· | Helpful(?) error messages with line numbers (can't run file, invalid syntax, etc.)
· | Added commands: HideAutoItWin, WinWaitNotActive, WinMove, WinSetTitle, DetectHiddenText, WinGetActiveTitle, SetWinDelay, Break, WinMinimizeAll, SplashTextOn, SplashTextOff, Repeat, EndRepeat.
· | Shows script name as a tooltip on the AutoIt system tray icon.
· | Following commands no longer wait for the window to exist before continuing: WinRestore, WinHide, WinMaximize, WinClose, WinMinimize.
· | If run with no parameters, AutoIt will bring up a "File Open" box.
· | Window in "reveal" mode always stays on top. (Now only one reveal mode required).
· | Changed MsgBox command to include a title, and to not hang around in the background.
· | Changed all "If...." commands to execute a given command rather than just jumping to a label.
· | Changed InputBox to include a title, and to not hang around in the background.
· | Invalid commands will now be treated as errors instead of just ignored.
· | '\n', '\t' can be used in MsgBox and InputBox text to indicate newlines and tabs.
· | Minimizes to a system tray icon. If the HideAutoItWin command is used nothing is visible at all.
· | Changed Adlib, now executes a given command instead of just sending keys.
· | Changed Sleep (internal) so that AutoIt window now updates during long Sleep functions.
· | Changed Gosub/Return. Can now have nested subroutines, only limited by free memory!
02/04/99 - v1.8
· | Added MsgBox and IfMsgBox commands. (Note, these have changed from 1.8 beta)
· | Added IfExist and IfNotExist commands for files and directories.
· | Added DOS environment variable support ( e.g. Send, Path is %PATH% ).
· | N.B. Because of this, the percent symbol '%' is now special. If you
· | really want to use this symbol you must do it twice ie. %%
· | Added SetEnv command.
· | Added InputBox command.
· | Added IfEqual and IfNotEqual commands.
· | Added Gosub and Return commands.
· | "Page-fault" bug fixed (when mouse coords are out of range).
14/03/99 - v1.7
· | Added {LWIN} and {RWIN} "Window key" keystrokes.
· | Added SetTitleMatchMode command. (Alters the way window titles are matched).
· | A blank window title is now valid. (e.g. WinWait,,Window text)
· | AutoIt executable grows for the first time to 44KB.
28/02/99 - v1.6
· | Added IfWinExist, IfWinNotExist, IfWinActive, IfWinNotActive commands.
· | Added support for labels (for the above commands).
· | Added Goto command.
· | Added Exit command.
· | Window titles are now case sensitive. i.e. "NOTEPAD" and "Notepad" are
· | different.
20/02/99 - v1.5
· | Added {PRINTSCREEN} command to simulate the "PrintScrn" key.
· | Copy and paste from the "reveal" mode. (Use CTRL-C to copy).
· | Added command line syntax - "AutoIt /?".
· | Added simulated mouse clicks (left and right).
· | Added mouse co-ordinates in "reveal" mode.
20/01/99 - v1.4
· | Added {BS}, {INSERT}, {ESCAPE} and {DELETE}
· | Added "/reveal2" command line switch. Cause AutoIt to update the reveal window every half second (useful for complex dialog windows)
18/01/99 - v1.3
· | Added WinClose command.
· | The title "WinWait,Notepad" will no longer match the window "Untitled - Notepad", but "WinWait,Untitled" will.
· | You can now use white spaces (spaces and tabs) all over the place to make the script file look pretty :)
14/01/99 - v1.2
· | Changed "Run" command. Asterisk (*) now states start of working directory.
· | Added [ADLIB] section support
· | Officially released on winfiles.com
12/01/99 - v1.1
· | Fixed WinActivate under Windows 98/NT 2000!
· | Added WinMaximize
· | Added executable version info
· | Added icons
12/01/99 - v1.0
· | Initial build (beta)


About LKei Design Group

Lkei Design Group specializes in Software Development and Web Design. While custom software products are our focus LKei has developed several products ready out of the box. Check out our website for a complete list of products and services.

LKei has four divisions:
1. Software Developement: Writing custom windows applications for personal and/or business use is one of LKei's specialties.
2. Website Design: LKei recently began offering development of Websites for business and personal use. One of LKei's specialties is in religious groups and churches.
3. Software Products : LKei continues to provides windows programs available for download and purchase form our website.

Check us out on the Web at www.LKei.com


About AutoIt

AutoIt is an automation tool. It can be used to automate any simple windows or DOS based task. It was primarily designed to assist in automatically installing software that cannot be automatically installed by other means. This is most useful during a PC rollout where hundreds or thousands of client machines need to be automatically installed. Many programs such as MS Office, Mcafee, IE4, etc. feature their own automated installation routines. Far too many programs, however, feature no way of automatic installation. That's where AutoIt comes in. AutoIt can also be used to automate small tasks on your machine.
When AutoIt is executed, it reads a specified script file. This script file allows AutoIt to perform a number of functions, these include
· | Executing programs (Windows applications, DOS commands, etc.)
· | Sending keystrokes and mouse clicks (all characters, keyboard layout independent).
· | Window functions (e.g. minimizing, hiding, restoring, waiting for, activating (even under Win98/NT2000)).
· | Simple text clipboard functions.
Best of all, its small (self contained .exe, no DLL's, no registry entries) and FREE! (And it will stay free).

AutoIt homepage


Overview

The AutoIt Script Editor is a companion utility for use with AutoIt.

The Editor makes creating and modifying scripts easy with its drag and drop features and popup command windows. Upon launching the program the editor begins with a new script and adding commands is aseasy as double-clicking the desired command. An easy to use Commad window appears prompting the user for the required parameter information for the command. Changing command line order is as simple as draggging the line of code from one line to another.

The convenient Routine and Variable Lists maintain an active list of Routines declared and Variables used within the script. Double-click a routine in the list and you are taken directly to the routine in the script.

The Favorties List stores you most commonly used command lines for quick ly ding them to your script. These favorties are not specific to one script, so you can build your favorites for use in any script.

Testing and Printing your scripts is easy from within the editor.


Launching the Script Editor

AutoIt Script Editor can be launched from the Windows Start Menu.

To start AutoIt Script Editor:

1. Click on the Windows Start menu.

2. Select Programs.

3. Select AutoIt Script Editor.

4. Select the Editor to start the program


Options / Preferences

The Script Editor allows the user to customize the look and feel of several of the editors options. From the appearance of the Routine/Variable List to the Favorites List and more, the user can modify the editor to act the way they want.

The first tab allows the user to save the position and size of the editor and to automatically load the last script upon startup.

The second tab indicates the location of the AutoIt and Aut2Exe programs on the user's computer. These location must be specified in order ot use the test feature in the editor.

The third tab is to tell the editor whether to insert backslashes when necessary in various comand parameters. (i.e. Filenames), and to set the default timeout value to appear in the Command window.

The next tab allows the end user to maintain a list of variables available by default for use in AutoIt scripts.

The last tab specifies whether to use the standard Windows Help or the newer HTML Help dialogs for displaying help with the editor.


Main Window

When you start the Script Editor for the first time, you'll notice a main window with a listing of commands on the left side of the editor window.

The Script Editor window can be configured to meet your needs. By using the options in the View menu, you can enable or disable the various views and option bars. The Script Editor window shown in the following figure is configured to display all possible components.

The Script Editor is divided into four sections:
1. The Main Editor Window
2. The Script Window
3. The Command List
4. The Routine/Variable List

The Main Editor Window
The Main Window contains the the script windows, the routine and variable lists, the command window and the menu and toolbar.

The Script Window contains the lines of script that make up the AutoIt script. Each line represents a different command to be passed to the AutoIt program when run. Lines can be rearranged by dragging them form one location to another in the script. Context menus are available by right-clicking anywhere in the Editor window. Multiple script windows can be opened and lines of script can be dragged between them.

The Command List
The Command List is located to the left of the Editor window. The list contains every command available in the currently supported version of AutoIt.
Commands can be added to the script several different ways:
1. By double-clicking on the desired command in the Command List.
2. By dragging the command to the desired location in the script.
3. By selecting the Add Command option from the menu or toolbar.
4. By right-clicking and selecting the Add Command feature form the context menu.

The Routine/Variable List
The Routine and Variable List is usually located below the Command List on the left of the Editor widow.
The Routine List contains all of the sub routines declared in the script.
The Variable List contains all of the variables used in the script.

The Menus

The menus provide access to most of Script Editor's features. Each of the menu commands can be found in the most relevant of the menu areas.

The Toolbar

The toolbar provides quick access to many of the most popular Script Editor features and options.


Command Window

The Command Window is used to assign values to the required parameters of the various AutoIt commands.

After choosing the command from the Command Window and selecting the Add Command option form the menu the Command Window will appear in the center of the screen prompting the user to enter the values for the paramters associated with the chosen command. Any command that does not require parameters will be inserted into the script without the Command Window appearing.

Below is the Command window with the MsgBox command parameters shown:


Aut2Exe Wizard

The Aut2Exe Wizard is a convenient way to access the Aut2Exe program and convert your script to an executable.

Upon selecting the Aut2Exe item from the Tools menu or the toolbar the wizard will appear.

Enter the name of the executable you want to conver tthe script to and optionally select an icon to use with the executable.
After selecting the filename press Ok and the conversion will run.

You will then be prompted with whether the conversion was successful.

Below is a screenshot of the Wizard.


Using the Script Editor


Working with Script Files


Opening Files

To open a script:

On the File menu, click Open.
In Look In, click the drive that contains the script you want to open.
Double-click the folder that contains the script you want to open.
Click the script name, and then click Open.

*Notes :
· | If you do not see the script you are looking for, you can click a different file type in Files of type.
· | You can open a script you opened recently by clicking its name in the File menu.


Creating New Scripts

To create a new script :

On the File menu, click New.

To save the new file, click the File menu, click Save As, and then type a name in File name.


Reopening Scripts

To reopen a recent script :

On the File menu, click Reopen.

The most recently used scripts will be listed.


Saving Scripts

To Save changes to a script:

On the File menu, click Save.

*Note : You can also save an existing script with a new name by clicking Save As and then typing a new name in File name.


Saving as New Script Template

To Save a script as the New Script Template

On the File menu, click Save as Template.

*Note : Once you have saved a script as the New Script Template any new scripts will have lines of script already loaded. This makes it easy for you to include some comments about the writer of the script without having to add the lines for every script you write.


Printing Scripts

To Print a script :

On the File menu, click Print.

*Note : You can also print an existing script by pressing the Print button on the toolbar.


Testing Scripts

To Test a Script from within the Editor:

Select the Tools|Test options from the menu.

If the script has not been saved you will be prompted to save it, but it is not necessary to test the script. Saving the script first is used as a precaution in case the script causes your system to lock up.


Converting Scripts to Executables

To convert your script to an executable using the Aut2Exe program:

Select Tools|Convert to EXE form the menu.

You will be prompted for the destination filename of your executable and whether you wish to change the default icon associated with it.

After the convesion you will be informed as to whether it was successful.


Writing Scripts


The Editor Window

The Editor Window is the main window in the Editor program. It is here that the script is displayed that you are creating. Each command that is added, edited is placed here. It is crutial that each line is placed in the proper order you wish to have it executed.
You can open multiple scripts at one time and drag lines of code between scripts.

The Editor window allows you to Edit the line using the Command Window, Manually Edit the line, change the order of the lines and copy and duplicate the lines quickly.

The Editor Window is displayed below:


Adding a Command

There are several ways to add a command to the script editor.
1. Highlight the desired command and select "Add Command" from the Edit menu.
2. Highlight the command and select "Add Command " from the context menu (right click).
3. Highlight the desired command and press the "Add Command" button on the toolbar.
4. Drag the desired command from the Command List to the place in the script you want the command to be placed.

You can also change the selected command by using the drop down list at the top of the command window.

Once a command has been selected and executed the Command window will appear and prompt you for the required parameter information for the command.

Below is an example of the command window with the MsgBox command chosen.


Editing a Command

There are several ways to edit a command in the script editor.
1. Highlight the desired script line and select "Edit Command" from the Edit menu.
2. Highlight the desired script line and select "Edit Command " from the context menu (right click).
3. Highlight the desired script line and press the "Edit Command" button on the toolbar.

You can also change the selected command by using the drop down list at the top of the command window.

Once a script line has been selected and executed the Command window will appear and display the current parameter values for the command. Simply make any changes ot the information and click "Ok".

Below is an example of the command window with the MsgBox command chosen.


Deleting a Command

To delete a command line from the current script, simply select the desired line and either select the "Delete Command" item from the Edit menu, press the "Delete Command" button from the toolbar, or right-click on the line and select "Delete Command".

You will be prompted for confirmation before the line is deleted.


Changing the order of script lines

If you wish to change the order of the lines of code in the script editor window, simply drag the lines form one line to another.


Copying / Appending / Inserting / Duplicating Lines

Copying / Appending / Inserting / Duplicating Lines / Duplicating
[Previous] [Main] [Next]

Copying, Appending, Inserting and Duplicating lines of script is a simple task within the editor.

Copying:
After selecting the line of script you wish to copy select the "Copy Command" item from the Edit menu or the context menu (right-click) and the item will be copied to the clipboard.

Appending:
Once a line of code has been copied you can select "Append Command" from the Edit menu to paste the line at the end of the script.

Inserting:
Inserting a copied line of code is as simple as Appending, Just move to the line you want to insert the code to and select "Insert Command" from the Edit menu.

Duplicating:
Besides the normal Copying, Appending and Inserting of lines, you can also quickly Duplicate a line of code by selecting the line and choosing "Duplicate|Append" or "Duplicate|Insert" from the Edit menu.


Inserting a Blank Line

You can insert a blank line in your script by selecting the item from the menu or context menu.

Blank lines help make your script easier to read


Using the Favorites List

The Favorites List is designed to give the user a place to store common lines of script that are used often in scripts.

Placing a Favorite in the script:
In order to insert a Favorite into the current script simply select the Favorite item from the menu or toolbar.

Adding a line of script to the Favorites List:
In order to add an item to the Favorites List, select the line of code and then choose "Add to Favorites List" from the menu or toolbar.

Organizing favorites:
If you wish to change the order or delete items in the Favorites List, you can do so by selecting the "Organize Favorites" from the Favorites menu. The window will appear with the Favorites in it and you can drag the items into the desired order.


Using the Routine/Variable List

The Routine and Variable Lists, usually located in the bottom left corner of the editor store the current list of Routines that are declared in the script and Variables being used.


Using the Command window

The Command Window is one of the best features of the Editor supllying the user with the proper parameters for each command.

When a command is selected to add or edit form the script the Command Window will appear with a brief description of the command and the required parameters will be displayed for the user to enter values for. Any entry that is labelled with bold lettering is required. Optional paramaters are not labelled in bold lettering.

Below are 2 samples of the Command Window.

The first has the WinWaitActive command selected:

The second example has the Send command selected:


Command Reference


Alphabetical Listing of Commands

Alphabetical Listing of Commands (Quick Reference)
[Previous] [Main] [Next]

Below is a list of the AutoIt commands currently supported by this version of the Script Editor.

ADLIB :
AdlibOff :
AdlibOn :
BlockInputOn:
BlockInputOff:
Break :
DetectHiddenText :
EndRepeat :
EnvAdd :
EnvSub :
Exit :
FileAppend:
FileReadLine:
Gosub :
Goto :
HideAutoItWin :
IfEqual :
IfExist :
IfGreater :
IfGreaterOrEqual :
IfLess :
IfLessOrEqual :
IfMsgBox :
IfNotEqual :
IfNotExist :
IfWinActive :
IfWinExist :
IfWinNotExist :
IfWinNotActive :
IniDelete:
IniRead :
IniWrite :
InputBox :
LeftClick :
LeftClickDrag :
MouseGetPos :
MouseMove :
MsgBox :
Random :
Repeat :
RegDelete:
RegRead:
RegWrite:
Return :
RightClick :
RightClickDrag :
Run :
RunWait :
Send :
SetEnv :
SetKeyDelay :
SetTitleMatchMode :
SetWinDelay :
Shutdown :
Sleep :
SplashTextOff :
SplashTextOn :
StringCaseSenseOff :
StringCaseSenseOn :
StringLeft :
StringLen :
StringMid :
StringReplace :
StringRight :
StrinTrimLeft :
StringTrimRight :
WinActivate :
WinClose :
WinGetActiveTitle :
WinHide :
WinKill :
WinMaximize :
WinMinimize :
WinMinimizeAll :
WinMove :
WinRestore :
WinSetTitle :
WinShow :
WinWait :
WinWaitActive :
WinWaitClose :
WinWaitNotActive :


Script File Syntax

The script file is a standard text file that can be given any extension (although .aut is the preferred extension). Each line can contain either a command, a comment, a label, or be left blank.
N.B. The maximum number of characters per line is 1024. Any extra characters will be ignored.
; Start of script
; Comments are indicated by a semi-colon

<Cmd>, <Cmd Parameters>
<Cmd2>, <Cmd2 Parameters>
<Cmd3>, <Cmd3 Parameters>

; This is a label, it must end with a colon (:) and it is used for commands such as Gosub and Goto.
label:

; End of script
Exit
; Start of the ADLIB section
[ADLIB]
<Title>, <Text>, <Cmd>, <Cmd Parameters>


Window Titles and Text

A number of script commands have "Window Title" and "Window Text" as parameters.

"Window Title" is text that appears in the windows title bar.
"Window Text" is any other text on that window, e.g. text on buttons such as "OK" and "Cancel".

Having "Window Text" allows you to distinguish between multiple windows that have the same title.

Neither the title nor text needs to be completely specified.
i.e. "Untitled - No" will match a window with the title "Untitled - Notepad".
See the text on the SetTitleMatchMode command for additions to this.

Use the "/reveal" mode to see what text is present on a window.

N.B. Windows titles and text are CASE SENSITIVE!!!!!


Send Command Syntax

The Send Command is probably the most widely used and often most complicated command. This command can imitiate keystrokes form th euser during a script.

See the Send Command in the command listing for a complete discussion of the syntax to be used.


Special characters in AutoIt

The slash "\", comma "," and percent "%" are treated as special characters, and you must be careful when using them.

"," is used to separate parameters in the script file.

"%" is used to indicate DOS variables.

If you wish to use any of these characters literally, you must precede them with the slash "\" character, i.e. "\," or "\%". If you wish to use a literal '\' you must precede this also, i.e. "\\".

The "\n" and "\t" sequences can be used to denote new lines and tabs in the AutoIt output functions MsgBox and InputBox.


DOS Environment Variables

You can use DOS environment variables anywhere in an AutoIt script. As in DOS batch files, just include the variable enclosed in percent (%) symbols.

For example, if you want to send the current DOS path to the notepad window you could do:

Run, notepad.exe
WinWaitActive, Untitled - Notepad
Send, This is the DOS path %PATH%

e.g. This example sets the variable test and then outputs it in a messagebox.
SetEnv, test, This is some output
MsgBox, 0, Example, %test%

N.B. Because of its special status, if you want to actually use a percent sign without it being changed into a variable, you must use the escape character '\' first.
e.g.
Send, This will send a single percent sign \%

You can also use "SetEnv" to set variables, but these changes will not be visible from DOS - the value will only be valid in the current script.

N.B. Many AutoIt commands specifically state that they take a variable, in these cases the % symbol is NOT used. A number of the examples that come with AutoIt demonstrate this.


The Clipboard Variable

The variable %CLIPBOARD% is special, and when used will be substituted for the text contents of the clipboard.

For example, if you copy the text "Hello!" to the clipboard and then run the following script:
MsgBox, 0, Example, The contents of the clipboard is: %clipboard%

The text "The contents of the clipboard is: Hello!" will be output to the screen.

Similarly, if you want to send text to the clipboard you can use the SetEnv command. E.g. To put the text "I'm some pasted text" into the clipboard you can run:
SetEnv, clipboard, I'm some pasted text


Special Variables

There are a number of special variables in AutoIt these are described below:

A_OSTYPE The type of Operating System being run. Either "WIN32_WINDOWS" or "WIN32_NT".
A_SCRIPTNAME The current script name, e.g. "myscript.aut".
A_SCRIPTDIR The directory that the current script resides in.
A_SCRIPTFULLPATH The full pathname of the current script, e.g. "C:\Windows\Scripts\myscript.aut". A_WORKINGDIR The current working directory.
A_SEC Seconds after the minute (00-59)
A_MIN Minutes after the hour (00-59)
A_HOUR Hours after midnight (00-23)
A_MDAY Day of the month (01-31)
A_MON Month of the year (01-12)
A_YEAR The current year (4 digit format, e.g. 2000)
A_WDAY Day of the week (1-7)
A_YDAY Day of the year (1-366)


Command Listing


ADLIB

The [ADLIB] section is optional, and if present should be placed at the end of the script file. The ADLIB section is designed to cope with unexpected conditions. The ADLIB section consists of single line commands that check if a window is active and if so, send keys to it.
The ADLIB section must start with the line "[ADLIB]".

The format of the a line in the ADLIB section is:

<Window Title>,<Window Text>,<Command>

e.g.
Run,Notepad.exe
WinWaitActive,Untitled - Notepad
Send,12345678#!{F4}
WinWaitClose,Untitled - Notepad

[ADLIB]
Notepad, save the changes?, Send, !n

Without the ADLIB section, this script would never end as Notepad would never
close until someone responded to the message "Do you want to save the changes?".

ADLIB commands must contain a window title and some text on the window. If there is no text on the window, or if you don't want to specify any, then you must use two commas.

e.g.
Run,Notepad.exe
WinWaitActive,Untitled - Notepad
Send,12345678#!{F4}
WinWaitClose,Untitled - Notepad

[ADLIB]
Notepad,, Send, !n


AdLibOff

This will diable processing of the [ADLIB] section.


AdLibOn

This will enable processing of the [ADLIB] section.


BlockInputOff

This command with disable both mouse and keyboard input. This only works on various operating system configurations as indicated below:

Windows 95: No effect.
Windows 98: User input is blocked but AutoIt is also unable to simulate input.
Windows NT 4 (Without ServicePack 6): No effect.
Windows NT 4 (With ServicePack 6): User input is blocked and AutoIt can simulate input.
Windows 2000 : User input is blocked and AutoIt can simulate input.

Input will be automatically enabled when the script closes.

e.g.
BlockInput, Off


BlockInputOn

This command with disable both mouse and keyboard input. This only works on various operating system configurations as indicated below:

Windows 95: No effect.
Windows 98: User input is blocked but AutoIt is also unable to simulate input.
Windows NT 4 (Without ServicePack 6): No effect.
Windows NT 4 (With ServicePack 6): User input is blocked and AutoIt can simulate input.
Windows 2000 : User input is blocked and AutoIt can simulate input.

Input will be automatically enabled when the script closes.

e.g.
BlockInput, On


Break Off

This command tells AutoIt whether or not the user can close AutoIt. Default is "on" (i.e. user can close AutoIt)

e.g.
Break, Off


Break On

This command tells AutoIt whether or not the user can close AutoIt. Default is "on" (i.e. user can close AutoIt)

e.g.
Break, On


Comment

A Comment can be added ot the script to help in debugging the script and reading what the code is intended to do.

A Comment must be preceded by a ";".


DetectHiddenText Off

Some programs use hidden windows and hidden text on windows (e.g. Backup Exec) this can cause problems when trying to script them. This command allows you to tell AutoIt whether or not to detect this hidden text. Default is "off".


DetectHiddenText On

Some programs use hidden windows and hidden text on windows (e.g. Backup Exec) this can cause problems when trying to script them. This command allows you to tell AutoIt whether or not to detect this hidden text. Default is "off".


EndRepeat

This will repeat a section of the script up to the following "EndRepeat" command a total of <Count> times. If <Count> is zero, the loop will be infinite. Repeat statements can be nested.

e.g.
Repeat, 10
MsgBox, 0, Example, This will be output ten times!
EndRepeat


EnvAdd

Allows you to add with Env variables. If the variable or value is not numeric, it will be taken to be zero (0).

e.g.
SetEnv, test, 20
EnvAdd, test, 20
MsgBox, 0, Example, %test%

This will output "40" to the screen.


EnvSub

Allows you to subtract with Env variables. If the variable or value is not numeric, it will be taken to be zero (0).

e.g.
SetEnv, test, 40
EnvSub, test, 20
MsgBox, 0, Example, %test%

This will output "20" to the screen.


Exit

This command will end the script.


FileAppend

FileAppend, <Text>, <Filename>
This command will append "Text" to the end of a file. If the file does not exist, it will be created.
e.g.
FileAppend, This is line 1\nThis is line 2\n, myfile.txt
This will append two lines of text to "myfile.txt", note the use of "\n" to indicate a newline is required.
If the command is successful %ERRORLEVEL% is set to 0, otherwise it is set to 1.


FileReadLine

FileReadLine, <Variable>, <Filename>, <Line>
This command will read a line from a file of text into a variable. Line 1 is taken to be the first line.
e.g.
FileReadLine, test, myfile.txt, 1

Will read the first line of "myfile.txt" into the %test% variable.
If the command is successful %ERRORLEVEL% is set to 0, otherwise it is set to 1.


GoSub

Just like the old BASIC commands. Gosub will branch to a specified label. Return will return to the line after the Gosub command.

e.g.
SetEnv, MyMessage, This is the first message!
Gosub, mysubroutine
SetEnv, MyMessage, This is the second message!
Gosub, mysubroutine
SetEnv, MyMessage, This is the third message!
Gosub, mysubroutine
Exit

mysubroutine:
MsgBox, 0, AutoIt, %MyMessage%
Return


Goto

Script execution will continue at the specified label.

e.g.
; This script will loop forever
myloop:
Sleep, 10
Goto, myloop


HideAutoItWin Off

This command can be used to completely hide the AutoIt window from the user. Useful for "silent" installs.

e.g.
HideAutoItWin, Onff


HideAutoItWin On

This command can be used to completely hide the AutoIt window from the user. Useful for "silent" installs.

e.g.
HideAutoItWin, On


IfEqual

Will compare the DOS variable <variable> with <text> and branch depending on the result.

e.g.
InputBox, MyVar, AutoIt, Please enter the word: WOMBLE
IfEqual, MyVar, WOMBLE, Goto, match
MsgBox, 0, AutoIt, You didnt type the correct word!
Exit
match:
MsgBox, 0, AutoIt, Well done! You typed in the correct word!


IfExist

Will cause the script to execute <Command> if the specified file or directory exists/doesn't exists.

e.g.
IfExist, C:\COMMAND.COM, Goto, fileexist
Exit
fileexist:

; Script will get to here if C:\COMMAND.COM DOES exist.
MsgBox, 0, AutoIt, File exists


IfGreater

IfGreater, <variable>, <number>, <Command>

Will compare the DOS variable <variable> with <number> and branch depending on the result. If the parameters are not numeric they will be treated as being zero.


IfGreaterOrEqual

IfGreaterOrEqual, <variable>, <number>, <Command>

Will compare the DOS variable <variable> with <number> and branch depending on the result. If the parameters are not numeric they will be treated as being zero.


IfLess

IfLess, <variable>, <number>, <Command>

Will compare the DOS variable <variable> with <number> and branch depending on the result. If the parameters are not numeric they will be treated as being zero.


IfLessOrEqual

IfLessOrEqual, <variable>, <number>, <Command>

Will compare the DOS variable <variable> with <number> and branch depending on the result. If the parameters are not numeric they will be treated as being zero.


IfMsgBox

Use this to execute a command based on the button the user pressed in the MsgBox command. Valid return values from MsgBox are:
ABORT, CANCEL, IGNORE, NO, OK, RETRY, YES

e.g. To put up a dialog box, with OK and CANCEL buttons, then branch if
the user selects CANCEL:

; Example Script
MsgBox, 1, AutoIt, This is a test message
IfMsgBox, CANCEL, Goto, cancellabel
Exit
cancellabel:
; If the script gets to here, user pressed cancel
MsgBox, 0, AutoIt, The user pressed cancel


IfNotEqual

Will compare the DOS variable <variable> with <text> and branch depending on the result.

e.g.
InputBox, MyVar, AutoIt, Please enter the word: WOMBLE
IfEqual, MyVar, WOMBLE, Goto, match
MsgBox, 0, AutoIt, You didnt type the correct word!
Exit
match:
MsgBox, 0, AutoIt, Well done! You typed in the correct word!


IfNotExist

Will cause the script to execute <Command> if the specified file or directory exists/doesn't exists.

e.g.
IfExist, C:\COMMAND.COM, Goto, fileexist
Exit
fileexist:

; Script will get to here if C:\COMMAND.COM DOES exist.
MsgBox, 0, AutoIt, File exists


IfWinActive

If the condition is met (i.e. the window title and text exists, is active, doesn't exist, is inactive) then the script will execute the <Command>.
N.B. If no window text is to be given you MUST include the extra comma.
e.g.
IfWinExist, Win Title, Win Text, Goto, label1
IfWinExist, Win Title,, Goto, label1


IfWinExist

If the condition is met (i.e. the window title and text exists, is active, doesn't exist, is inactive) then the script will execute the <Command>.
N.B. If no window text is to be given you MUST include the extra comma.
e.g.
IfWinExist, Win Title, Win Text, Goto, label1
IfWinExist, Win Title,, Goto, label1


IfWinNotActive

If the condition is met (i.e. the window title and text exists, is active, doesn't exist, is inactive) then the script will execute the <Command>.
N.B. If no window text is to be given you MUST include the extra comma.
e.g.
IfWinExist, Win Title, Win Text, Goto, label1
IfWinExist, Win Title,, Goto, label1


IfWinNotExist

If the condition is met (i.e. the window title and text exists, is active, doesn't exist, is inactive) then the script will execute the <Command>.
N.B. If no window text is to be given you MUST include the extra comma.
e.g.
IfWinExist, Win Title, Win Text, Goto, label1
IfWinExist, Win Title,, Goto, label1


IniDelete

IniDelete, <Filename>, <Section>, <Key>

Allows reading and writing of standard windows .ini files., i.e. the following format.

[SectionName]
KeyName=Value

e.g. To delete the DOS path information into the same section and key:
IniDelete, c:\\mypath\\myfile.ini, mysection, mykey

NB. The full path and filename of the .ini file must be given.


IniRead

Allows reading of standard windows .ini files., i.e. the following format.

[SectionName]
KeyName=Value

e.g. To read the value of "mykey" from the "mysection" part of an ini file, into the variable "%result%":
IniRead, result, c:\\mypath\\myfile.ini, mysection, mykey

NB. The full path and filename of the .ini file must be given.


IniWrite

Allows writing of standard windows .ini files., i.e. the following format.

[SectionName]
KeyName=Value

e.g. To write the text "womble" into the same section and key:
IniWrite, womble, c:\\mypath\\myfile.ini, mysection, mykey

e.g. To write the DOS path information into the same section and key:
IniWrite, %path%, c:\\mypath\\myfile.ini, mysection, mykey

NB. The full path and filename of the .ini file must be given.


InputBox

Will cause a dialog box with <message> to appear. The user can enter text, press OK, and the text will be stored in the DOS variable <variable>. If the "hide" parameter is used, input will be masked (eg. for passwords).

e.g.
InputBox, MyMessage, AutoIt, Please - Enter some text to display!
MsgBox, 0, AutoIt, %MyMessage%

e.g.
InputBox, password, AutoIt, Please enter your password (input is hidden), hide


LeftClick

Simulates a left mouse button click. The X and Y co-ordinates are relative to the currently active window. Run AutoIt in reveal mode to determine the required co-ordinates of a window.
To perform a double-click, simply run the command twice :)


LeftClickDrag

Drags the mouse pointer from x1,y1 to x2,y2 with the relevant mousebutton held down. The co-ordinates are relative to the current active window.


MouseGetPos

This command will get the current position of the mouse cursor into the 'x' and 'y' variables. The co-ords are relative to the active window.

e.g.
MouseGetPos, xpos, ypos
MsgBox, 0, Examples, The mouse is at position %xpos% %ypos%


MouseMove

This command will move the mouse cursor to the position <xpos>, <ypos>. The co-ords are relative to the active window.


MsgBox

Displays a dialog box with the specified message. Different display modes will give different results (appearance, number of buttons). A list of modes is given below, add up the numbers of the display modes you want.

e.g. To display "Hello" with just an "OK" button:
MsgBox, 0, AutoIt, Hello

e.g. To display "Hello" with an exclamation box and OK and Cancel:
MsgBox, 49, AutoIt, Hello
(1=OKCANCEL, 48=Exclamation, = 49)

Function AutoIt Value
MB_OK 0
MB_OKCANCEL 1
MB_ABORTRETRYIGNORE 2
MB_YESNOCANCEL 3
MB_YESNO 4
MB_RETRYCANCEL 5

MB_ICONHAND 16
MB_ICONQUESTION 32
MB_ICONEXCLAMATION 48
MB_ICONASTERISK 64

MB_APPLMODAL 0
MB_SYSTEMMODAL 4096
MB_TASKMODAL 8192


Random

Random, <min value>, <max Value>

This command produces a random number between <min value> and <max value>


RegDelete

RegDelete, RegKey, RegSubKey, ValueName

This command will delete a regsitry value. If the command is successful %ERRORLEVEL% is set to 0, otherwise it is set to 1.

e.g. To delete the wallpaper value of the current user (not particularly recommended :) ):
RegDelete, HKEY_CURRENT_USER, Control Panel\\Desktop, Wallpaper


RegRead

This command allows you to read REG_SZ and REG_DWORD values from the regsitry. If the command is successful %ERRORLEVEL% is set to 0, otherwise it is set to 1.

RegKey must be either "HKEY_LOCAL_MACHINE", "HKEY_CURRENT_USER", "HKEY_USERS", "HKEY_CURRENT_CONFIG" or "HKEY_CLASSES_ROOT".
ValueType must be "REG_DWORD" or "REG_SZ".

e.g. To read the location of the "Program Files" directory into the variable "TestKey":
RegRead, TestKey, REG_SZ, HKEY_LOCAL_MACHINE, Software\\Microsoft\\Windows\\CurrentVersion, ProgramFilesDir
MsgBox, 0, Example, Program Files are located in %TestKey%


RegWrite

Similar to the RegRead command, this command will allow you to create or modify a registry key. If the command is successful %ERRORLEVEL% is set to 0, otherwise it is set to 1.

e.g. To change the wallpaper of the current user:
RegWrite, REG_SZ, HKEY_CURRENT_USER, Control Panel\\Desktop, Wallpaper, C:\\Mycrazybitmap.bmp


Repeat

This will repeat a section of the script up to the following "EndRepeat" command a total of <Count> times. If <Count> is zero, the loop will be infinite. Repeat statements can be nested.

e.g.
Repeat, 10
MsgBox, 0, Example, This will be output ten times!
EndRepeat


Return


RightClick

Simulates a right mouse button click. The X and Y co-ordinates are relative to the currently active window. Run AutoIt in reveal mode to determine the required co-ordinates of a window.
To perform a double-click, simply run the command twice :)


RightClickDrag

Drags the mouse pointer from x1,y1 to x2,y2 with the relevant mousebutton held down. The co-ordinates are relative to the current active window.


Routine

Select the Routine command to declare a routine in the script.


Run

Executes a given program and proceeds to the next line of the script. N.B. The program to run and the working directory are separated by a comma ','. The working directory is optional.

>>>>> N.B. Because the '\' character is special you must use '\\' when specifying paths! <<<<<

e.g.
Run, notepad.exe, C:\\WINDOWS
Run, C:\\Program Files\\Microsoft Office\\Office\\WinWord.exe

The first command runs notepad and sets the working directory to "C:\WINDOWS".
The second command runs MS Word in the current directory.

You can also run command interpreter commands line Echo, Copy, etc.

e.g.
Run, COMMAND.COM /C Echo Hello > C:\\Hello.txt
OR
Run, %COMSPEC% /C Echo Hello > C:\\Hello.txt

Creates a file called C:\Hello.txt containing the word "Hello".


RunWait

Same as the Run command but waits for the program to finish before continuing.

Will also set the variable %ERRORLEVEL% to the return code of the program.


Send

Sends a set of keystrokes to the currently active window. (The syntax of these keystrokes can be found in the following section).

The "Send" command syntax is similar to that of ScriptIt and the Visual Basic "SendKeys" command. Characters are sent as written with the exception of the following characters:

'!'
This tells AutoIt to send an ALT keystroke, therefore "Send,This is text!a" would send the keys "This is text" and then press "ALT+a".

N.B. Some programs are very choosy about capital letters and ALT keys, i.e. "!A" is different to "!a". The first says ALT+SHIFT+A, the second is ALT+a. If in doubt, use lowercase!

'+'
This tells AutoIt to send a SHIFT keystroke, therefore "Send,Hell+o" would send the text "HellO". "Send,!+a" would send "ALT+SHIFT+a".

'^'
This tells AutoIt to send a CONTROL keystroke, therefore "Send,^!a" would send "CTRL+ALT+a".

N.B. Some programs are very choosy about capital letters and CTRL keys, i.e. "^A" is different to "^a". The first says CTRL+SHIFT+A, the second is CTRL+a. If in doubt, use lowercase!

'#'
The hash is used as a key delimiter to make a line easier to read. i.e. "Send, H#e#l#l#o" is the same as "Send,Hello".

Certain special keys can be sent and should be enclosed in braces:

Send Command Resulting Keypress
{!} !
{#} #
{+} +
{^} ^
{{} {
{}} }
{SPACE} SPACE
{ENTER} ENTER
{ALT} ALT
{BACKSPACE} or {BS} BACKSPACE
{DELETE} or {DEL} DELETE
{UP} Cursor up
{DOWN} Cursor down
{LEFT} Cursor left
{RIGHT} Cursor right
{HOME} HOME
{END} END
{ESCAPE} or {ESC} ESCAPE
{INSERT} or {INS} INS
{PGUP} PGUP
{PGDN} PGDN
{F1} - {F12} Function keys
{TAB} TAB
{PRINTSCREEN} PRINTSCR
{LWIN} Left Windows key
{RWIN} Right Windows key
{NUMLOCK} NUMLOCK
{CTRLBREAK} Ctrl+break
{PAUSE} PAUSE
{CAPSLOCK} CAPSLOCK
{NUMPAD0} - {NUMPAD 9} Numpad digits
{NUMPADMULT} Numpad Multiply
{NUMPADADD} Numpad Add
{NUMPADSUB} Numpad Subtract
{NUMPADDIV} Numpad Divide
{NUMPADDOT} Numpad period
{APPSKEY} Windows App key
{ALTDOWN} Holds the ALT key down until {ALTUP} is sent
{SHIFTDOWN} Holds the SHIFT key down until {SHIFTUP} is sent
{CTRLDOWN} Holds the CTRL key down until {CTRLUP} is sent
{ASC nnnn} Send the ALT+nnnn key combination

To send the ASCII value A (same as pressing ALT+65 on the numeric keypad)
Send, {ASC 65}

Single keys can also be repeated, e.g.
Send, {DEL 4} Presses the DEL key 4 times
Send, {S 30} Sends 30 'S' characters
Send, +{TAB 4} Presses SHIFT+TAB 4 times


SetEnv

This command will set an environment variable to the specified value.
N.B. This variable only exists within AutoIt you will not be able to access it from DOS.

e.g. To set the Env variable "ERROR" to "There has been an error":
SetEnv, ERROR, There has been an error.

To use this variable, use the percent symbol:

e.g. After running the previous command, this will output "There has been an error":
MsgBox, 1, AutoIt, %ERROR%


SetKeyDelay

Changes the delay between keystrokes in milliseconds. Max is 32767.
Default is 20ms. 1000 milliseconds = 1 second.


SetTitleMatchMode

Changes the way that window titles are matched against the script.
Valid modes are "1" and "2" - the default is "1". This mode affects most of the commands within AutoIt that have any sort of window title and text in the command, i.e. WinWait, WinWaitActive, IfWinActive, etc.

e.g.
; Script using mode 1 (default)
SetTitleMatchMode, 1

; Script using mode 2
SetTitleMatchMode, 2

mode 1:

In the script you specify the start of a window title to match. i.e. for the notepad.exe window (Untitled - Notepad), valid matches would be:
"Untitled", "Untitled -", "Unt" and "Untitled - Notepad".

mode 2:

In the script you can specify ANY substring of the window title you want to match. Again for the notepad.exe window valid matches would be:
"Untitled", "Untitled - Notepad", "Notepad", "No".


SetWinDelay

This changes the time that AutoIt pauses after carrying out a window related function (waiting for, minimizing, restoring, etc.) before continuing. This is useful on very slow machines, or when you have things like window animation enabled. The default is 500 milliseconds.

e.g.
SetWinDelay, 2000
Run, Notepad.exe
WinWaitActive, Untitled - Notepad
Send, Hello

In this example there would be a pause of 2000 milliseconds (2 seconds) after notepad has started until the words "Hello" appear.


Shutdown

This command allows you to perform various forms of shutdown. The type is determined by <Flag>.
The flag can be a combination from the table below:

Function Flag
Log off the current user 0
Shutdown the workstation 1
Reboot the workstation 2
Force closing of applications (may lose unsaved work) 4
Shutdown and power off (if supported) 8

e.g. To shutdown and force applications to close without saving = Shutdown + Force = 1 + 4 = 5:
Shutdown, 5


Sleep

Halts execution of the script for the given number of milliseconds. Max is 32767.
1000 milliseconds = 1 second.


SplashTextOff

Removes the splash text screen from view.


SplashTextOn

This command brings up a window the specified message and title. The window stays topmost without interfering with windows behind it. Useful for automation when you can bring up a "Don't Touch" message for the user without affecting other windows.


StringCaseSense, On

StringCaseSense, On

This command will turn case sensitivity on for the commands:
IfEqual
IfNotEqual
IfInString
IfNotInString
StringReplace


StringCaseSense, Off

StringCaseSense, Off

This command will turn case sensitivity off for the commands:
IfEqual
IfNotEqual
IfInString
IfNotInString
StringReplace


StringLeft

StringLeft,<output variable>, <input variable>, <number of chars to extract>

This command takes the contents of <input variable>, extracts a number of characters and places the results in <output variable>.

*Extracts the leftmost characters from input variable.


StringLen

StringLen, <output variable>, <input variable>

This command takes the contents of <input variable> and puts the number of characters in the string into <output variable>.


StringMid

StringMid, <output variable>, <input variable>, <start char>, <number of chars to extract>

This command takes the contents of <Input variable>, extract a number of characters starting from <start char> and place the result in <output variable>.


StringReplace

StringReplace, <output variab le>, <input variable>, <search string>, <replace string>

This command will search for the <search string> in the contents of the variable <input variable>. The search string will be replaced by <replace string> and the result will be placed in the <output variable>. If the search string cannot be found, the contents of <output variable> will be the same as <input variable>.


StringRight

StringRight,<output variable>, <input variable>, <number of chars to extract>

This command takes the contents of <input variable>, extracts a number of characters and places the results in <output variable>.

*Extracts the rightmost characters from input variable.


StringTrimLeft

StringTrimLeft, <output variable>, <inpur variable>, <number of characters to trim>

This command takes the contents of <input variable>, trims a number of characters and places the result in <output variable>

*Trims the leftmost characters


StringTrimRight

StringTrimRight, <output variable>, <inpur variable>, <number of characters to trim>

This command takes the contents of <input variable>, trims a number of characters and places the result in <output variable>

*Trims the rightmost characters


WinActivate

If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<


WinClose

If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<


WinGetActiveTitle

This command gets the title of the active window and puts it in the DOS variable <Variable>

e.g.
Sleep, 2000
WinGetActiveTitle, myvar
MsgBox, 0, AutoIt, The active window was %myvar%


WinHide

If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<


WinKill

Similar to WinClose, but if the window has not closed after a couple of seconds (Asking to save, crashed, etc.) the window will be forcibly terminated.


WinMaximize

If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<


WinMinimize

If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<


WinMinimizeAll

Simply, this command minimizes all windows.


WinMove

If the window in Title and Text exists, it is moved to <X>, <Y> and resized to <Width>, <Height>

e.g.

Run, notepad.exe
WinWaitActive, Untitled - Notepad
WinMove, Untitled - Notepad,, 0, 0, 100, 100

This moves the notepad window to 0,0 and changes the size of the window to 100,100

Remember to include the comma if you don't specify Window text. "default" can be used in place of Width and Height if you don't want to change the size of the window

e.g.
WinMove, Untitled - Notepad,, 0, 0, default, default


WinRestore

If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<


WinSetTitle

Use this command to rename a window.

e.g.
Run, notepad.exe
WinWaitActive, Untitled - Notepad
WinSetTitle, Untitled - Notepad,, Renamed Notepad!


WinShow

If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<


WinWait

Stops script execution until the specified window exists. The window does not need be active.

If specified the "Timeout" is in seconds. After the line has executed the Env variable %ERRORLEVEL% will be set to 0 if the function completed normally, or 1 if the wait timed out. The maximum value of Timeout is 32767 seconds.

e.g. Wait forever for the notepad window
WinWait, Untitled - Notepad

e.g. Wait for five seconds for the notepad window
WinWait, Untitled - Notepad,, 5


WinWaitActive

Stops script execution until the specified window to exists and is active.

If specified the "Timeout" is in seconds. After the line has executed the Env variable %ERRORLEVEL% will be set to 0 if the function completed normally, or 1 if the wait timed out.


WinWaitClose

Stops script execution until the specified window ceases to exist.
If specified the "Timeout" is in seconds. After the line has executed the Env variable %ERRORLEVEL% will be set to 0 if the function completed normally, or 1 if the wait timed out.

e.g.
WinWaitClose, Untitled - Notepad


WinWaitNotActive
[Previous] [Main]

Stops script execution until the specified window ceases to be active.
If specified the "Timeout" is in seconds. After the line has executed the Env variable %ERRORLEVEL% will be set to 0 if the function completed normally, or 1 if the wait timed out.


.topic 200

AutoIt Script Editor is designed to assist in the creation of AutoIt scripts for use with AutoIt by Jonathan Bennett. The Script Editor is intuitive enough to provide the user with required parameters for each script command available, stores a list of variables and routines used by each script, and can be tested from within the editor.
Anyone using AutoIt for automated installations needs this editor to help build scripts faster then ever before. You no longer need to know all the syntax for each command because the editor does it for you.

Version 2.51 of the Script Editor supports AutoIt version 2.51.

AutoIt Script Editor is developed by Lee Boswell of the LKei Design Group. Visit our website to check out other products and services available from LKei.(www.LKei.com)

AutoIt is developed by Jonathan Bennett and can be downloaded from his website at AutoIt homepage

.topic 201
While LKei Design Group is not responsible for damages or problems to a user's computer by this software, we do want to provide reasonable assitance in the use of the Script Editor.

Questions, comments and suggestions can be addressed to Lee Boswell and LeeBoswell@hotmail.com.

A moderate knowledgebase and FAQ listing can also be viewed at LKei's home site. (www.LKei.com)

.topic 202
IMPORTANT—This is a legal agreement between you (either an individual or an entity) and LKei Design Group. By opening and/or using this software you acknowledge that you have read this license agreement, understand it, and agree to be bound by its terms.You further agree that it is the full and complete agreement between us. If you do not agree to the terms of this agreement, you must cease using this product immediately.

LKei Design Group Software License Agreement

GRANT OF LICENSE. This License Agreement permits you the use of the enclosed LKei Design Group software program (AutoIt Script Editor). The SOFTWARE is in "use" on a computer when it is loaded into temporary memory (i.e. RAM) or installed into permanent memory (e.g. hard disk, CD-ROM, or other storage device) of that computer.

COPYRIGHT. The SOFTWARE is owned by LKei Design Group and is protected by United States copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE like any other copyrighted material (e.g. a book or musical recording) except that you may either (a) make one copy of the SOFTWARE solely for backup or archival purposes, or (b) transfer the SOFTWARE to a single hard disk provided you keep the original solely for backup or archival purposes. You may not copy the written materials accompanying the SOFTWARE.

LIMITED WARRANTY. This program is provided "as is" without any warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the SOFTWARE is with you, the licensee. Should the SOFTWARE prove defective, you assume the risk and liability for the entire cost of all necessary repair, service, or correction. Some states/jurisdictions do not allow the exclusion of implied warranties, so the above exclusion may not apply to you. This warranty gives you specific legal rights, and you may have other rights which vary from state/jurisdiction to state/jurisdiction.

LKei Design Group does not warranty the functions contained in the SOFTWARE will meet your requirements, or that the operation of the SOFTWARE will be error-free or uninterrupted.

NO LIABILITY FOR CONSEQUENTIAL DAMAGES. To the maximum extent permitted by applicable law, in no event shall LKei Design Group be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use or inability to use this LKei Design Group product, even if LKei Design Group has been advised of the possibility of such damages or for any claim by any other party. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.

.topic 203
The AutoIt Script Editor has many features that make building scripts quick and easy. Without an extended knowledge of the syntax language you can build scripts within minutes.

Below is a list of the primary features of the Script Editor:

Muliple scripts can be opened at one time.
Drag and drop between scripts.
List of all supported commands listed for easy selection.
Popup dialog box for required parameters for all commands.
Favorites List to store most commonly used script lines.
Routine and Variable List of all routines and variables used in the script.
Drag and drop capablity to rearrange lines of script.
Drag and drop capability to add commands to desired location in the script.
Intuitive editor inserts double-backslashes for filenames and directories.
Manual edit feature allows a user to make changes to a line of script manually.
Script Test feature allows the user to launch the script from within the editor for quick testing.
Convenient link to the Aut2Exe program to convert the script to an executable from within the editor.
Preferences allow the user to cusotmize the look and feel of the editor window.
Last used script can be set to load upon startup.
Favorites List and Routine/Varible List are dockable.
Link to open the current script in Notepad. (for those who may still want to)
Print feature makes it easy to print out your scripts.
New template feature makes starting a script easier. Select a predesigned template and your on your way

.topic 204
12/13/00	Version 2.51a
Corrected problem with Command form not allowing Run command to be entered.

12/06/00	Version 2.51
Added Wise Update feature to check on the web to see if a new version is available.
Added support for AutoIt 2.5 which includes 9 new commands (StringLeft, StringRight, StirngMid, StringLen, StringTrimLeft, StringTrimRight, StringReplace, StringCaseSense and Random)
Fixed a bug with the Edit Command when you want to edit a command that has no parameters.
If no file was last accessed then a new script opens by default.
Corrected some focus controls that were not functional on the Command form.
Corrected a bug that occurred when editing a command that had "On" or "Off" as a parameter (i.e. Break, On).

11/09/00	Version 2.5
Added support for AutoIt 2.5 which included 4 new commands (IfGreater, IfGreaterOrEqual, IfLess and IfLessOrEqual)
Fixed a bug with the background colors showing up as black in the command window and script window.
Jumped version number up to 2.5 to make it easier to determine which version of AutoIt the editor supports

08/08/00	Version 2.31
Fixed a bug with the RegRead and RegWrite commands. (When editing the commands an error was produced)

07/24/00	Version 2.3
Added support for AutoIt 2.42 which includes then following new commands:
        IniDelete, RegDelete, BlockInput, FileAppend, FileReadLine

05/08/00	Version 2.23
Fixed a bug with the Variables List in the Preferences dialog box
Added a menu choice to add and delete Variables to the current and all open scripts
Added a menu choice to run AutoIt Reveal Mode
Fixed a bug that occurred when you saved a new script and the name was not updated in the Window menu

04/28/00	Version 2.2
Fixed a bug with the opening of the last accessed scripts.
The Save Editor position and size was not maximizing the window properly
Corrected a problem with the Add Backslash feature
Added the curent script Line Number to the status bar and a "Go to Line Number" menu item.
Fixed a bug with the Save As feature.
Corrected a problem when changing the Script Window Font Color.
Added the "Open in Notepad" feature to the Tools menu  *Was removed in Version 2 and added back after much request
Added a "Refresh Script from File" item in the Edit menu which will reload the script form the file. This was added so that if you are working on a script and then use the "Open in Notepad" featue and make changes to the script, you can select "Refresh script form file" to relead the script in the window.
Revamped the Find and Replace options

04/12/00	Version 2.1
Fixed a bug with the loading of background color selections from the Registry
Fixed a bug with the send command
Fixed a bug with the Variables list not updating properly

03/15/00	Version 2.0
Support for AutoIt version 2.41
New version is MDI (Multiple Document Interface) Application that allows multiple scripts to be opened at one time.
Windows 2000 menu and toolbars with most recently used capabilities to hide unused items
Drag and Drop support between scripts
Additional Routine and Variable support
Favorites List now integrated into the toolbar and menu
Editor colors and font can be customized
Script can be saved as a template for new scripts. All new scripts would contain lines of code contained in the template.
Find / Find and Replace capability added for locating strings in your script.
AutoSave feature can save your current scripts at user defined intervals
Script Builder feature allows a user to build a script will running an install program - Coming soon!!

02/01/00	Version 1.33
Fixed bug with the SplashTextOn command ("Cannot focus on a disabled window" message)
Added some Shortcut commands to a few features. i.e. The delete key will perform a Delete Command, and Insert will Add a Command.
When using the Send command a second backslash is added when '\' is pressed (only if option is checked in the Preferences).
When using the Send command you can now select an entry in the key list and when new keys are pressed they are inserted rather than always being added to the end of the list.
Fixed a bug with the Routine list.

01/13/00	Version 1.3
Fixed bug with the ading of a double-backslash  for filenames, directories and before literal characters
Added ability to change the command selected form the Command form. (great for editing a line when you edit the command by changing it to a totally different command.
Changed URL links to reflect HiddenSoft's new website.

01/04/00	Version 1.22
Minor bug fix with the Test Script feature
Code changes to better handle variable and routine handling

12/15/99	Version 1.2
Added support for AutoIt version 2.32
Implemented the Aut2Exe Wizard for use with the Aut2Exe program
Corrected minor bugs with the Command Dialog box
Added the "Manual Add Command" feature
Added Online Help

11/23/99	Version 1.1
Added support for AutoIt version 2.23
Added Favorite List for saving common command lines
Added Routine and Variable Listing
Corrected minor bugs with the Send Command

11/08/99	Version 1.0
First initial release
See Feature List for complete listing of Script Editor features.

.topic 205
03/12/2000 - v2.51
Installation routine changed to use Microsoft Windows Installer.
Added commands StringLeft, StringRight, StringMid, StringLen, StringTrimLeft, StringTrimRight, IfInString, IfNotInString, StringReplace.
String comparisons (IfEqual, IfNotEqual, IfInString, IfNotInString, StringReplace) can have case sensitivity controlled by the StringCaseSense command.
Added Random number command.
Fixed bug with MsgBox and InputBox under NT4 (as a result the AutoIt window will be visible in the taskbar during these commands).
Fixed ADLIB section so that Gosub and Goto commands will work correctly.

07/11/2000 - v2.5
Fixed access rights with RegRead, RegWrite and RegDelete commands for non-administrator use under Windows NT.
Added commands IfLess, IfLessOrEqual, IfGreater, IfGreaterOrEqual.
Reveal mode includes the dimensions of the active window.

17/6/2000 - v2.42
Added IniDelete, RegDelete, commands.
Added the BlockInput command to disable mouse and keyboard input. (N.B. only works satisfactorily under Win2000/NT4 SP6 - best I could do I'm afraid)
The "/p" is now NOT case sensitive for command line parameters.
The WinWait routines' "Timeout" is now accurate.
Added simple file routines FileAppend and FileReadLine.
If you use the {CTRLDOWN}, {SHIFTDOWN} or {ALTDOWN} keys, the keys will be left "down" unless specified otherwise with the {CTRLUP}, {SHIFTUP} or {ALTUP} keys (even after the end of a line in the script). Use these keys wisely :)

11/02/2000 - v2.41
Bug with RegWrite fixed.
09/02/2000 - v2.4
Problems with variables containing commas fixed.
Lots of variables added to access times, dates, current script path, OS (NT or 9x).
Can pause and resume script execution by right-clicking on the taskbar icon.
SIMPLE registry read/write functions added for REG_SZ and REG_DWORD types.
Fixed a bug with command line parameters and quotes.
20/12/99 - v2.32
Some quite brutal optimizing applied, bringing the executable sizes down by 12k.
Aut2Exe remembers the last directory used for the script, executable and icon.
Can specify command line parameters with spaces by using quotes ("....").
12/12/99 - v2.31
Maximum script line length increased to 1024 characters (extra characters are ignored).
Memory usage when running scripts reduced by a factor of 12! (Not that I ever had any complaints :) )
10/12/99 - v2.3
Various bugs with ENV variables fixed.
Now sends correctly to DOS (I hope :) ).
Optional parameter added to InputBox for masking input.
Command line parameters can be passed to the script.
Now supports user-defined icons when compiling a script to an .exe.
MouseGetPos and MouseMove commands added.
Not using ASPack anymore, although feel free to use it or any other EXE compression utility on AutoIt yourself (http://www.aspack.com).
25/11/99 - v2.23
WinActivate tweaked for Win2000 RC2.
Shutdown command added.
WinKill command added.
23/11/99 - v2.22
The variable %CLIPBOARD% contains the textual contents of the clipboard.
Can now paste text from AutoIt to the clipboard.
INI File reading and writing added with IniRead and IniWrite.
20/11/99 - v2.21
Can now Send decimal ASCII codes, like when using using the ALT key and the numeric keypad (e.g. ALT+65 = 'A'). Very useful for sending characters that don't usually work (e.g. '~' on an Italian keyboard)
18/11/99 - v2.2
Can now Run programs as either hidden, maximized or minimized (great for avoiding black screens when executing DOS commands)
RunWait will put a program's return code in %ERRORLEVEL%
The WinWait group of functions can be set to timeout after a period of time (%ERRORLEVEL% can be checked to see if the function timed out or not)
WinShow command added (previously, there was no easy way to "undo" a WinHide!!!!)
16/09/99 - v2.11
Fixed bug in which ENV variables were not expanded under the "Adlib" section.
Installation recreated under Win98 to resolve some setup problems.
11/09/99 - v2.1
Aut2Exe Script Converter added to installation.
Internal bug in Run and RunWait fixed.
Added keys {CTRLUP}, {CTRLDOWN}, {SHIFTUP}, {SHIFTDOWN}, {ALTUP}, {ALTDOWN}.
28/08/99 - v2.03
AutoIt2.exe and AutoItX.dll now packed with ASPack reducing the executable size.
Changed SplashTextOn command. You no longer have to do SplashTextOff before doing a second SplashTextOn.
Added simple variable EnvAdd and EnvSub commands.
"default" can be used in place of Width and Height in the WinMove command.
Added commands LeftClickDrag and RightClickDrag.
26/08/99 - v2.02
Changes to some internal timings.
Made the splash windows like a little less "win 3.1 - ish".
Added AdlibOn and AdlibOff commands.
Changed internal handling of the ADLIB section.
18/08/99 - v2.01
Fixed Send command with multiple modifiers (i.e. CTRL+SHIFT+key, CTRL+ALT+key).
16/08/99 - v2.0
NB. Some changes mean that old AutoIt scripts may need to be modified slightly - Please re-read the documentation carefully if you are upgrading! Hence the jump from v1.8 to v2.0 - SORRY, but things needed changing to ease implementation of new commands that have been requested. I personally use v1.8 for old scripts and v2.0 for any new scripts I write.
Can now send most keystrokes to DOS windows - Finally!
Changed the way in which '\', ',' and '%' are treated - CAREFUL!
Changed Run and RunWait commands. Comma ',' now delimits working directory. (therefore '*' is now valid - for wildcards, etc.)
Added numerous keys that can be sent including WinApps key.
AutoIt window shows line number and line of script during execution.
Helpful(?) error messages with line numbers (can't run file, invalid syntax, etc.)
Added commands: HideAutoItWin, WinWaitNotActive, WinMove, WinSetTitle, DetectHiddenText, WinGetActiveTitle, SetWinDelay, Break, WinMinimizeAll, SplashTextOn, SplashTextOff, Repeat, EndRepeat.
Shows script name as a tooltip on the AutoIt system tray icon.
Following commands no longer wait for the window to exist before continuing: WinRestore, WinHide, WinMaximize, WinClose, WinMinimize.
If run with no parameters, AutoIt will bring up a "File Open" box.
Window in "reveal" mode always stays on top. (Now only one reveal mode required).
Changed MsgBox command to include a title, and to not hang around in the background.
Changed all "If...." commands to execute a given command rather than just jumping to a label.
Changed InputBox to include a title, and to not hang around in the background.
Invalid commands will now be treated as errors instead of just ignored.
'\n', '\t' can be used in MsgBox and InputBox text to indicate newlines and tabs.
Minimizes to a system tray icon. If the HideAutoItWin command is used nothing is visible at all.
Changed Adlib, now executes a given command instead of just sending keys.
Changed Sleep (internal) so that AutoIt window now updates during long Sleep functions.
Changed Gosub/Return. Can now have nested subroutines, only limited by free memory!
02/04/99 - v1.8
Added MsgBox and IfMsgBox commands. (Note, these have changed from 1.8 beta)
Added IfExist and IfNotExist commands for files and directories.
Added DOS environment variable support ( e.g. Send, Path is %PATH% ).
N.B. Because of this, the percent symbol '%' is now special. If you
really want to use this symbol you must do it twice ie. %%
Added SetEnv command.
Added InputBox command.
Added IfEqual and IfNotEqual commands.
Added Gosub and Return commands.
"Page-fault" bug fixed (when mouse coords are out of range).
14/03/99 - v1.7
Added {LWIN} and {RWIN} "Window key" keystrokes.
Added SetTitleMatchMode command. (Alters the way window titles are matched).
A blank window title is now valid. (e.g. WinWait,,Window text)
AutoIt executable grows for the first time to 44KB.
28/02/99 - v1.6
Added IfWinExist, IfWinNotExist, IfWinActive, IfWinNotActive commands.
Added support for labels (for the above commands).
Added Goto command.
Added Exit command.
Window titles are now case sensitive. i.e. "NOTEPAD" and "Notepad" are
different.
20/02/99 - v1.5
Added {PRINTSCREEN} command to simulate the "PrintScrn" key.
Copy and paste from the "reveal" mode. (Use CTRL-C to copy).
Added command line syntax - "AutoIt /?".
Added simulated mouse clicks (left and right).
Added mouse co-ordinates in "reveal" mode.
20/01/99 - v1.4
Added {BS}, {INSERT}, {ESCAPE} and {DELETE}
Added "/reveal2" command line switch. Cause AutoIt to update the reveal window every half second (useful for complex dialog windows)
18/01/99 - v1.3
Added WinClose command.
The title "WinWait,Notepad" will no longer match the window "Untitled - Notepad", but "WinWait,Untitled" will.
You can now use white spaces (spaces and tabs) all over the place to make the script file look pretty :)
14/01/99 - v1.2
Changed "Run" command. Asterisk (*) now states start of working directory.
Added [ADLIB] section support
Officially released on winfiles.com
12/01/99 - v1.1
Fixed WinActivate under Windows 98/NT 2000!
Added WinMaximize
Added executable version info
Added icons
12/01/99 - v1.0
Initial build (beta)

.topic 206

Lkei Design Group specializes in Software Development and Web Design. While custom software products are our focus LKei has developed several products ready out of the box. Check out our website for a complete list of products and services.

LKei has four divisions:
1. Software Developement: Writing custom windows applications for personal and/or business use is one of LKei's specialties.
2. Website Design: LKei recently began offering development of Websites for business and personal use. One of LKei's specialties is in religious groups and churches.
3. Software Products : LKei continues to provides windows programs available for download and purchase form our website.

Check us out on the Web at www.LKei.com

.topic 207

AutoIt is an automation tool. It can be used to automate any simple windows or DOS based task. It was primarily designed to assist in automatically installing software that cannot be automatically installed by other means. This is most useful during a PC rollout where hundreds or thousands of client machines need to be automatically installed. Many programs such as MS Office, Mcafee, IE4, etc. feature their own automated installation routines. Far too many programs, however, feature no way of automatic installation. That's where AutoIt comes in. AutoIt can also be used to automate small tasks on your machine.
When AutoIt is executed, it reads a specified script file. This script file allows AutoIt to perform a number of functions, these include
Executing programs (Windows applications, DOS commands, etc.)
Sending keystrokes and mouse clicks (all characters, keyboard layout independent).
Window functions (e.g. minimizing, hiding, restoring, waiting for, activating (even under Win98/NT2000)).
Simple text clipboard functions.
Best of all, its small (self contained .exe, no DLL's, no registry entries) and FREE! (And it will stay free).

AutoIt homepage

.topic 300
The AutoIt Script Editor is a companion utility for use with AutoIt.

The Editor makes creating and modifying scripts easy with its drag and drop features and popup command windows. Upon launching the program the editor begins with a new script and adding commands is aseasy as double-clicking the desired command. An easy to use Commad window appears prompting the user for the required parameter information for the command. Changing command line order is as simple as draggging the line of code from one line to another.

The convenient Routine and Variable Lists maintain an active list of Routines declared and Variables used within the script. Double-click a routine in the list and you are taken directly to the routine in the script.

The Favorties List stores you most commonly used command lines for quick ly ding them to your script. These favorties are not specific to one script, so you can build your favorites for use in any script.

Testing and Printing your scripts is easy from within the editor.

.topic 301
AutoIt Script Editor can be launched from the Windows Start Menu.

To start AutoIt Script Editor:

1. Click on the Windows Start menu.

2. Select Programs.

3. Select AutoIt Script Editor.

4. Select the Editor to start the program

.topic 302
The Script Editor allows the user to customize the look and feel of several of the editors options. From the appearance of the Routine/Variable List to the Favorites List and more, the user can modify the editor to act the way they want.

The first tab allows the user to save the position and size of the editor and to automatically load the last script upon startup.

The second tab indicates the location of the AutoIt and Aut2Exe programs on the user's computer. These location must be specified in order ot use the test feature in the editor.

The third tab is to tell the editor whether to insert backslashes when necessary in various comand parameters. (i.e. Filenames), and to set the default timeout value to appear in the Command window.

The next tab allows the end user to maintain a list of variables available by default for use in AutoIt scripts.

The last tab specifies whether to use the standard Windows Help or the newer HTML Help dialogs for displaying help with the editor.

.topic 303
When you start the Script Editor for the first time, you'll notice a main window with a listing of commands on the left side of the editor window.

The Script Editor window can be configured to meet your needs. By using the options in the View menu, you can enable or disable the various views and option bars. The Script Editor window shown in the following figure is configured to display all possible components.

The Script Editor is divided into four sections:
    1. The Main Editor Window
    2. The Script Window
    3. The Command List
    4. The Routine/Variable List

The Main Editor Window
    The Main Window contains the the script windows, the routine and variable lists, the command window and the menu and toolbar.

The Script Window contains the lines of script that make up the AutoIt script. Each line represents a different command to be passed to the AutoIt program when run. Lines can be rearranged by dragging them form one location to another in the script. Context menus are available by right-clicking anywhere in the Editor window. Multiple script windows can be opened and lines of script can be dragged between them.

The Command List
    The Command List is located to the left of the Editor window. The list contains every command available in the currently supported version of AutoIt.
    Commands can be added to the script several different ways:
        1. By double-clicking on the desired command in the Command List.
        2. By dragging the command to the desired location in the script.
        3. By selecting the Add Command option from the menu or toolbar.
        4. By right-clicking and selecting the Add Command feature form the context menu.

The Routine/Variable List
    The Routine and Variable List is usually located below the Command List on the left of the Editor widow.
    The Routine List contains all of the sub routines declared in the script.
    The Variable List contains all of the variables used in the script.

The Menus

    The menus provide access to most of Script Editor's features. Each of the menu commands can be found in the most relevant of the menu areas.

The Toolbar

    The toolbar provides quick access to many of the most popular Script Editor features and options.

.topic 304
The Command Window is used to assign values to the required parameters of the various AutoIt commands.

After choosing the command from the Command Window and selecting the Add Command option form the menu the Command Window will appear in the center of the screen prompting the user to enter the values for the paramters associated with the chosen command. Any command that does not require parameters will be inserted into the script without the Command Window appearing.

Below is the Command window with the MsgBox command parameters shown:

.topic 305
The Aut2Exe Wizard is a convenient way to access the Aut2Exe program and convert your script to an executable.

Upon selecting the Aut2Exe item from the Tools menu or the toolbar the wizard will appear.

Enter the name of the executable you want to conver tthe script to and optionally select an icon to use with the executable.
After selecting the filename press Ok and the conversion will run.

You will then be prompted with whether the conversion was successful.

Below is a screenshot of the Wizard.

.topic 400
To open a script:

On the File menu, click Open.
In Look In, click the drive that contains the script you want to open.
Double-click the folder that contains the script you want to open.
Click the script name, and then click Open.

*Notes :
If you do not see the script you are looking for, you can click a different file type in Files of type.
You can open a script you opened recently by clicking its name in the File menu.

.topic 401
To create a new script :

On the File menu, click New.

To save the new file, click the File menu, click Save As, and then type a name in File name.

.topic 406
To reopen a recent script :

On the File menu, click Reopen.

The most recently used scripts will be listed.

.topic 402
To Save changes to a script:

On the File menu, click Save.

*Note : You can also save an existing script with a new name by clicking Save As and then typing a new name in File name.

.topic 407
To Save a script as the New Script Template

On the File menu, click Save as Template.

*Note : Once you have saved a script as the New Script Template any new scripts will have lines of script already loaded. This makes it easy for you to include some comments about the writer of the script without having to add the lines for every script you write.

.topic 403
To Print a script :

On the File menu, click Print.

*Note : You can also print an existing script by pressing the Print button on the toolbar.

.topic 404
To Test a Script from within the Editor:

Select the Tools|Test options from the menu.

If the script has not been saved you will be prompted to save it, but it is not necessary to test the script. Saving the script first is used as a precaution in case the script causes your system to lock up.

.topic 405
To convert your script to an executable using the Aut2Exe program:

Select Tools|Convert to EXE form the menu.

You will be prompted for the destination filename of your executable and whether you wish to change the default icon associated with it.

After the convesion you will be informed as to whether it was successful.

.topic 413
The Editor Window is the main window in the Editor program. It is here that the script is displayed that you are creating. Each command that is added, edited is placed here. It is crutial that each line is placed in the proper order you wish to have it executed.
You can open multiple scripts at one time and drag lines of code between scripts.

The Editor window allows you to Edit the line using the Command Window, Manually Edit the line, change the order of the lines and copy and duplicate the lines quickly.

The Editor Window is displayed below:

.topic 406
There are several ways to add a command to the script editor.
    1. Highlight the desired command and select "Add Command" from the Edit menu.
    2. Highlight the command and select "Add Command " from the context menu (right click).
    3. Highlight the desired command and press the "Add Command" button on the toolbar.
    4. Drag the desired command from the Command List to the place in the script you want the command to be placed.

You can also change the selected command by using the drop down list at the top of the command window.

Once a command has been selected and executed the Command window will appear and prompt you for the required parameter information for the command.

Below is an example of the command window with the MsgBox command chosen.

.topic 407
There are several ways to edit a command in the script editor.
    1. Highlight the desired script line and select "Edit Command" from the Edit menu.
    2. Highlight the desired script line and select "Edit Command " from the context menu (right click).
    3. Highlight the desired script line and press the "Edit Command" button on the toolbar.

You can also change the selected command by using the drop down list at the top of the command window.

Once a script line has been selected and executed the Command window will appear and display the current parameter values for the command. Simply make any changes ot the information and click "Ok".

Below is an example of the command window with the MsgBox command chosen.

.topic 408
To delete a command line from the current script, simply select the desired line and either select the "Delete Command" item from the Edit menu, press the "Delete Command" button from the toolbar, or right-click on the line and select "Delete Command".

You will be prompted for confirmation before the line is deleted.

.topic 409
If you wish to change the order of the lines of code in the script editor window, simply drag the lines form one line to another.

.topic 410
Copying, Appending, Inserting and Duplicating lines of script is a simple task within the editor.

Copying:
After selecting the line of script you wish to copy select the "Copy Command" item from the Edit menu or the context menu (right-click) and the item will be copied to the clipboard.

Appending:
Once a line of code has been copied you can select "Append Command" from the Edit menu to paste the line at the end of the script.

Inserting:
Inserting a copied line of code is as simple as Appending, Just move to the line you want to insert the code to and select "Insert Command" from the Edit menu.

Duplicating:
Besides the normal Copying, Appending and Inserting of lines, you can also quickly Duplicate a line of code by selecting the line and choosing "Duplicate|Append" or "Duplicate|Insert" from the Edit menu.

.topic 415
You can insert a blank line in your script by selecting the item from the menu or context menu.

Blank lines help make your script easier to read

.topic 411
The Favorites List is designed to give the user a place to store common lines of script that are used often in scripts.

Placing a Favorite in the script:
In order to insert a Favorite into the current script simply select the Favorite item from the menu or toolbar.

Adding a line of script to the Favorites List:
In order to add an item to the Favorites List, select the line of code and then choose "Add to Favorites List" from the menu or toolbar.

Organizing favorites:
If you wish to change the order or delete items in the Favorites List, you can do so by selecting the "Organize Favorites" from the Favorites menu. The window will appear with the Favorites in it and you can drag the items into the desired order.

.topic 414
The Routine and Variable Lists, usually located in the bottom left corner of the editor store the current list of Routines that are declared in the script and Variables being used.

.topic 412
The Command Window is one of the best features of the Editor supllying the user with the proper parameters for each command.

When a command is selected to add or edit form the script the Command Window will appear with a brief description of the command and the required parameters will be displayed for the user to enter values for. Any entry that is labelled with bold lettering is required. Optional paramaters are not labelled in bold lettering.

Below are 2 samples of the Command Window.

The first has the WinWaitActive command selected:

The second example has the Send command selected:

.topic 500
Below is a list of the AutoIt commands currently supported by this version of the Script Editor.

ADLIB :
AdlibOff :
AdlibOn :
BlockInputOn:
BlockInputOff:
Break :
DetectHiddenText :
EndRepeat :
EnvAdd :
EnvSub :
Exit :
FileAppend:
FileReadLine:
Gosub :
Goto :
HideAutoItWin :
IfEqual :
IfExist :
IfGreater :
IfGreaterOrEqual :
IfLess :
IfLessOrEqual :
IfMsgBox :
IfNotEqual :
IfNotExist :
IfWinActive :
IfWinExist :
IfWinNotExist :
IfWinNotActive :
IniDelete:
IniRead :
IniWrite :
InputBox :
LeftClick :
LeftClickDrag :
MouseGetPos :
MouseMove :
MsgBox :
Random :
Repeat :
RegDelete:
RegRead:
RegWrite:
Return :
RightClick :
RightClickDrag :
Run :
RunWait :
Send :
SetEnv :
SetKeyDelay :
SetTitleMatchMode :
SetWinDelay :
Shutdown :
Sleep :
SplashTextOff :
SplashTextOn :
StringCaseSenseOff :
StringCaseSenseOn :
StringLeft :
StringLen :
StringMid :
StringReplace :
StringRight :
StrinTrimLeft :
StringTrimRight :
WinActivate :
WinClose :
WinGetActiveTitle :
WinHide :
WinKill :
WinMaximize :
WinMinimize :
WinMinimizeAll :
WinMove :
WinRestore :
WinSetTitle :
WinShow :
WinWait :
WinWaitActive :
WinWaitClose :
WinWaitNotActive :

.topic 501
The script file is a standard text file that can be given any extension (although .aut is the preferred extension). Each line can contain either a command, a comment, a label, or be left blank.
N.B. The maximum number of characters per line is 1024. Any extra characters will be ignored.
; Start of script
; Comments are indicated by a semi-colon

<Cmd>, <Cmd Parameters>
<Cmd2>, <Cmd2 Parameters>
<Cmd3>, <Cmd3 Parameters>

; This is a label, it must end with a colon (:) and it is used for commands such as Gosub and Goto.
label:

; End of script
Exit
; Start of the ADLIB section
[ADLIB]
<Title>, <Text>, <Cmd>, <Cmd Parameters>

.topic 502
A number of script commands have "Window Title" and "Window Text" as parameters.

"Window Title" is text that appears in the windows title bar.
"Window Text" is any other text on that window, e.g. text on buttons such as "OK" and "Cancel".

Having "Window Text" allows you to distinguish between multiple windows that have the same title.

Neither the title nor text needs to be completely specified.
i.e. "Untitled - No" will match a window with the title "Untitled - Notepad".
See the text on the SetTitleMatchMode command for additions to this.

Use the "/reveal" mode to see what text is present on a window.

N.B. Windows titles and text are CASE SENSITIVE!!!!!

.topic 503
The Send Command is probably the most widely used and often most complicated command. This command can imitiate keystrokes form th euser during a script.

See the Send Command in the command listing for a complete discussion of the syntax to be used.

.topic 504
The slash "\", comma "," and percent "%" are treated as special characters, and you must be careful when using them.

"," is used to separate parameters in the script file.

"%" is used to indicate DOS variables.

If you wish to use any of these characters literally, you must precede them with the slash "\" character, i.e. "\," or "\%". If you wish to use a literal '\' you must precede this also, i.e. "\\".

The "\n" and "\t" sequences can be used to denote new lines and tabs in the AutoIt output functions MsgBox and InputBox.

.topic 505
You can use DOS environment variables anywhere in an AutoIt script. As in DOS batch files, just include the variable enclosed in percent (%) symbols.

For example, if you want to send the current DOS path to the notepad window you could do:

Run, notepad.exe
WinWaitActive, Untitled - Notepad
Send, This is the DOS path %PATH%

e.g. This example sets the variable test and then outputs it in a messagebox.
SetEnv, test, This is some output
MsgBox, 0, Example, %test%

N.B. Because of its special status, if you want to actually use a percent sign without it being changed into a variable, you must use the escape character '\' first.
e.g.
Send, This will send a single percent sign \%

You can also use "SetEnv" to set variables, but these changes will not be visible from DOS - the value will only be valid in the current script.

N.B. Many AutoIt commands specifically state that they take a variable, in these cases the % symbol is NOT used. A number of the examples that come with AutoIt demonstrate this.

.topic 506
The variable %CLIPBOARD% is special, and when used will be substituted for the text contents of the clipboard.

For example, if you copy the text "Hello!" to the clipboard and then run the following script:
MsgBox, 0, Example, The contents of the clipboard is: %clipboard%

The text "The contents of the clipboard is: Hello!" will be output to the screen.

Similarly, if you want to send text to the clipboard you can use the SetEnv command. E.g. To put the text "I'm some pasted text" into the clipboard you can run:
SetEnv, clipboard, I'm some pasted text

.topic 507
There are a number of special variables in AutoIt these are described below:

A_OSTYPE 			The type of Operating System being run. Either "WIN32_WINDOWS" or 				"WIN32_NT".
A_SCRIPTNAME 		The current script name, e.g. "myscript.aut".
A_SCRIPTDIR 		The directory that the current script resides in.
A_SCRIPTFULLPATH 	The full pathname of the current script, e.g. "C:\Windows\Scripts\myscript.aut". A_WORKINGDIR 		The current working directory.
A_SEC 			Seconds after the minute (00-59)
A_MIN 			Minutes after the hour (00-59)
A_HOUR 			Hours after midnight (00-23)
A_MDAY 			Day of the month (01-31)
A_MON 			Month of the year (01-12)
A_YEAR 			The current year (4 digit format, e.g. 2000)
A_WDAY 			Day of the week (1-7)
A_YDAY 			Day of the year (1-366)

.topic 1
The [ADLIB] section is optional, and if present should be placed at the end of the script file. The ADLIB section is designed to cope with unexpected conditions. The ADLIB section consists of single line commands that check if a window is active and if so, send keys to it.
The ADLIB section must start with the line "[ADLIB]".

The format of the a line in the ADLIB section is:

<Window Title>,<Window Text>,<Command>

e.g.
Run,Notepad.exe
WinWaitActive,Untitled - Notepad
Send,12345678#!{F4}
WinWaitClose,Untitled - Notepad

[ADLIB]
Notepad, save the changes?, Send, !n

Without the ADLIB section, this script would never end as Notepad would never
close until someone responded to the message "Do you want to save the changes?".

ADLIB commands must contain a window title and some text on the window. If there is no text on the window, or if you don't want to specify any, then you must use two commas.

e.g.
Run,Notepad.exe
WinWaitActive,Untitled - Notepad
Send,12345678#!{F4}
WinWaitClose,Untitled - Notepad

[ADLIB]
Notepad,, Send, !n

.topic 2
This will diable processing of the [ADLIB] section.

.topic 3
This will enable processing of the [ADLIB] section.

.topic 4
This command with disable both mouse and keyboard input. This only works on various operating system configurations as indicated below:

Windows 95:  No effect.
Windows 98: User input is blocked but AutoIt is also unable to simulate input.
Windows NT 4 (Without ServicePack 6): No effect.
Windows NT 4 (With ServicePack 6): User input is blocked and AutoIt can simulate input.
Windows 2000	: User input is blocked and AutoIt can simulate input.

Input will be automatically enabled when the script closes.

e.g.
BlockInput, Off

.topic 5
This command with disable both mouse and keyboard input. This only works on various operating system configurations as indicated below:

Windows 95:  No effect.
Windows 98: User input is blocked but AutoIt is also unable to simulate input.
Windows NT 4 (Without ServicePack 6): No effect.
Windows NT 4 (With ServicePack 6): User input is blocked and AutoIt can simulate input.
Windows 2000	: User input is blocked and AutoIt can simulate input.

Input will be automatically enabled when the script closes.

e.g.
BlockInput, On

.topic 6
This command tells AutoIt whether or not the user can close AutoIt. Default is "on" (i.e. user can close AutoIt)

e.g.
Break, Off

.topic 7
This command tells AutoIt whether or not the user can close AutoIt. Default is "on" (i.e. user can close AutoIt)

e.g.
Break, On

.topic 8
A Comment can be added ot the script to help in debugging the script and reading what the code is intended to do.

A Comment must be preceded by a ";".

.topic 9
Some programs use hidden windows and hidden text on windows (e.g. Backup Exec) this can cause problems when trying to script them. This command allows you to tell AutoIt whether or not to detect this hidden text. Default is "off".

.topic 10
Some programs use hidden windows and hidden text on windows (e.g. Backup Exec) this can cause problems when trying to script them. This command allows you to tell AutoIt whether or not to detect this hidden text. Default is "off".

.topic 11
This will repeat a section of the script up to the following "EndRepeat" command a total of <Count> times. If <Count> is zero, the loop will be infinite. Repeat statements can be nested.

e.g.
Repeat, 10
MsgBox, 0, Example, This will be output ten times!
EndRepeat

.topic 12
Allows you to add with Env variables. If the variable or value is not numeric, it will be taken to be zero (0).

e.g.
SetEnv, test, 20
EnvAdd, test, 20
MsgBox, 0, Example, %test%

This will output "40" to the screen.

.topic 13
Allows you to subtract with Env variables. If the variable or value is not numeric, it will be taken to be zero (0).

e.g.
SetEnv, test, 40
EnvSub, test, 20
MsgBox, 0, Example, %test%

This will output "20" to the screen.

.topic 14
This command will end the script.

.topic 15
FileAppend, <Text>, <Filename>
This command will append "Text" to the end of a file. If the file does not exist, it will be created.
e.g.
FileAppend, This is line 1\nThis is line 2\n, myfile.txt
This will append two lines of text to "myfile.txt", note the use of "\n" to indicate a newline is required.
If the command is successful %ERRORLEVEL% is set to 0, otherwise it is set to 1.

.topic 16
FileReadLine, <Variable>, <Filename>, <Line>
This command will read a line from a file of text into a variable. Line 1 is taken to be the first line.
e.g.
FileReadLine, test, myfile.txt, 1

Will read the first line of "myfile.txt" into the %test% variable.
If the command is successful %ERRORLEVEL% is set to 0, otherwise it is set to 1.

.topic 17
Just like the old BASIC commands. Gosub will branch to a specified label. Return will return to the line after the Gosub command.

e.g.
SetEnv, MyMessage, This is the first message!
Gosub, mysubroutine
SetEnv, MyMessage, This is the second message!
Gosub, mysubroutine
SetEnv, MyMessage, This is the third message!
Gosub, mysubroutine
Exit

mysubroutine:
MsgBox, 0, AutoIt, %MyMessage%
Return

.topic 18
Script execution will continue at the specified label.

e.g.
; This script will loop forever
myloop:
Sleep, 10
Goto, myloop

.topic 19
This command can be used to completely hide the AutoIt window from the user. Useful for "silent" installs.

e.g.
HideAutoItWin, Onff

.topic 20
This command can be used to completely hide the AutoIt window from the user. Useful for "silent" installs.

e.g.
HideAutoItWin, On

.topic 21
Will compare the DOS variable <variable> with <text> and branch depending on the result.

e.g.
InputBox, MyVar, AutoIt, Please enter the word: WOMBLE
IfEqual, MyVar, WOMBLE, Goto, match
MsgBox, 0, AutoIt, You didnt type the correct word!
Exit
match:
MsgBox, 0, AutoIt, Well done! You typed in the correct word!

.topic 22
Will cause the script to execute <Command> if the specified file or directory exists/doesn't exists.

e.g.
IfExist, C:\COMMAND.COM, Goto, fileexist
Exit
fileexist:

; Script will get to here if C:\COMMAND.COM DOES exist.
MsgBox, 0, AutoIt, File exists

.topic 23
IfGreater, <variable>, <number>, <Command>

Will compare the DOS variable <variable> with <number> and branch depending on the result. If the parameters are not numeric they will be treated as being zero.

.topic 24
IfGreaterOrEqual, <variable>, <number>, <Command>

Will compare the DOS variable <variable> with <number> and branch depending on the result. If the parameters are not numeric they will be treated as being zero.

.topic 25
IfLess, <variable>, <number>, <Command>

Will compare the DOS variable <variable> with <number> and branch depending on the result. If the parameters are not numeric they will be treated as being zero.

.topic 26
IfLessOrEqual, <variable>, <number>, <Command>

Will compare the DOS variable <variable> with <number> and branch depending on the result. If the parameters are not numeric they will be treated as being zero.

.topic 27
Use this to execute a command based on the button the user pressed in the MsgBox command. Valid return values from MsgBox are:
ABORT, CANCEL, IGNORE, NO, OK, RETRY, YES

e.g. To put up a dialog box, with OK and CANCEL buttons, then branch if
the user selects CANCEL:

; Example Script
MsgBox, 1, AutoIt, This is a test message
IfMsgBox, CANCEL, Goto, cancellabel
Exit
cancellabel:
; If the script gets to here, user pressed cancel
MsgBox, 0, AutoIt, The user pressed cancel

.topic 28
Will compare the DOS variable <variable> with <text> and branch depending on the result.

e.g.
InputBox, MyVar, AutoIt, Please enter the word: WOMBLE
IfEqual, MyVar, WOMBLE, Goto, match
MsgBox, 0, AutoIt, You didnt type the correct word!
Exit
match:
MsgBox, 0, AutoIt, Well done! You typed in the correct word!

.topic 29
Will cause the script to execute <Command> if the specified file or directory exists/doesn't exists.

e.g.
IfExist, C:\COMMAND.COM, Goto, fileexist
Exit
fileexist:

; Script will get to here if C:\COMMAND.COM DOES exist.
MsgBox, 0, AutoIt, File exists

.topic 30
If the condition is met (i.e. the window title and text exists, is active, doesn't exist, is inactive) then the script will execute the <Command>.
N.B. If no window text is to be given you MUST include the extra comma.
e.g.
IfWinExist, Win Title, Win Text, Goto, label1
IfWinExist, Win Title,, Goto, label1

.topic 31
If the condition is met (i.e. the window title and text exists, is active, doesn't exist, is inactive) then the script will execute the <Command>.
N.B. If no window text is to be given you MUST include the extra comma.
e.g.
IfWinExist, Win Title, Win Text, Goto, label1
IfWinExist, Win Title,, Goto, label1

.topic 32
If the condition is met (i.e. the window title and text exists, is active, doesn't exist, is inactive) then the script will execute the <Command>.
N.B. If no window text is to be given you MUST include the extra comma.
e.g.
IfWinExist, Win Title, Win Text, Goto, label1
IfWinExist, Win Title,, Goto, label1

.topic 33
If the condition is met (i.e. the window title and text exists, is active, doesn't exist, is inactive) then the script will execute the <Command>.
N.B. If no window text is to be given you MUST include the extra comma.
e.g.
IfWinExist, Win Title, Win Text, Goto, label1
IfWinExist, Win Title,, Goto, label1

.topic 34
IniDelete, <Filename>, <Section>, <Key>

Allows reading and writing of standard windows .ini files., i.e. the following format.

[SectionName]
KeyName=Value

e.g. To delete the DOS path information into the same section and key:
IniDelete, c:\\mypath\\myfile.ini, mysection, mykey

NB. The full path and filename of the .ini file must be given.

.topic 35
Allows reading of standard windows .ini files., i.e. the following format.

[SectionName]
KeyName=Value

e.g. To read the value of "mykey" from the "mysection" part of an ini file, into the variable "%result%":
IniRead, result, c:\\mypath\\myfile.ini, mysection, mykey

NB. The full path and filename of the .ini file must be given.

.topic 36
Allows writing of standard windows .ini files., i.e. the following format.

[SectionName]
KeyName=Value

e.g. To write the text "womble" into the same section and key:
IniWrite, womble, c:\\mypath\\myfile.ini, mysection, mykey

e.g. To write the DOS path information into the same section and key:
IniWrite, %path%, c:\\mypath\\myfile.ini, mysection, mykey

NB. The full path and filename of the .ini file must be given.

.topic 37
Will cause a dialog box with <message> to appear. The user can enter text, press OK, and the text will be stored in the DOS variable <variable>. If the "hide" parameter is used, input will be masked (eg. for passwords).

e.g.
InputBox, MyMessage, AutoIt, Please - Enter some text to display!
MsgBox, 0, AutoIt, %MyMessage%

e.g.
InputBox, password, AutoIt, Please enter your password (input is hidden), hide

.topic 38
Simulates a left mouse button click. The X and Y co-ordinates are relative to the currently active window. Run AutoIt in reveal mode to determine the required co-ordinates of a window.
To perform a double-click, simply run the command twice :)

.topic 39
Drags the mouse pointer from x1,y1 to x2,y2 with the relevant mousebutton held down. The co-ordinates are relative to the current active window.

.topic 40
This command will get the current position of the mouse cursor into the 'x' and 'y' variables. The co-ords are relative to the active window.

e.g.
MouseGetPos, xpos, ypos
MsgBox, 0, Examples, The mouse is at position %xpos% %ypos%

.topic 41
This command will move the mouse cursor to the position <xpos>, <ypos>. The co-ords are relative to the active window.

.topic 42
Displays a dialog box with the specified message. Different display modes will give different results (appearance, number of buttons). A list of modes is given below, add up the numbers of the display modes you want.

e.g. To display "Hello" with just an "OK" button:
MsgBox, 0, AutoIt, Hello

e.g. To display "Hello" with an exclamation box and OK and Cancel:
MsgBox, 49, AutoIt, Hello
(1=OKCANCEL, 48=Exclamation, = 49)

Function				AutoIt Value
MB_OK					0
MB_OKCANCEL				1
MB_ABORTRETRYIGNORE		2
MB_YESNOCANCEL			3
MB_YESNO					4
MB_RETRYCANCEL			5

MB_ICONHAND				16
MB_ICONQUESTION 			32
MB_ICONEXCLAMATION			48
MB_ICONASTERISK			64

MB_APPLMODAL				0
MB_SYSTEMMODAL			4096
MB_TASKMODAL				8192

.topic 43
Random, <min value>, <max Value>

This command produces a random number between <min value> and <max value>

.topic 44
RegDelete, RegKey, RegSubKey, ValueName

This command will delete a regsitry value. If the command is successful %ERRORLEVEL% is set to 0, otherwise it is set to 1.

e.g. To delete the wallpaper value of the current user (not particularly recommended :) ):
RegDelete, HKEY_CURRENT_USER, Control Panel\\Desktop, Wallpaper

.topic 45
This command allows you to read REG_SZ and REG_DWORD values from the regsitry. If the command is successful %ERRORLEVEL% is set to 0, otherwise it is set to 1.

RegKey must be either "HKEY_LOCAL_MACHINE", "HKEY_CURRENT_USER", "HKEY_USERS", "HKEY_CURRENT_CONFIG" or "HKEY_CLASSES_ROOT".
ValueType must be "REG_DWORD" or "REG_SZ".

e.g. To read the location of the "Program Files" directory into the variable "TestKey":
RegRead, TestKey, REG_SZ, HKEY_LOCAL_MACHINE, Software\\Microsoft\\Windows\\CurrentVersion, ProgramFilesDir
MsgBox, 0, Example, Program Files are located in %TestKey%

.topic 46
Similar to the RegRead command, this command will allow you to create or modify a registry key. If the command is successful %ERRORLEVEL% is set to 0, otherwise it is set to 1.

e.g. To change the wallpaper of the current user:
RegWrite, REG_SZ, HKEY_CURRENT_USER, Control Panel\\Desktop, Wallpaper, C:\\Mycrazybitmap.bmp

.topic 47
This will repeat a section of the script up to the following "EndRepeat" command a total of <Count> times. If <Count> is zero, the loop will be infinite. Repeat statements can be nested.

e.g.
Repeat, 10
MsgBox, 0, Example, This will be output ten times!
EndRepeat

.topic 48

.topic 49
Simulates a right mouse button click. The X and Y co-ordinates are relative to the currently active window. Run AutoIt in reveal mode to determine the required co-ordinates of a window.
To perform a double-click, simply run the command twice :)

.topic 50
Drags the mouse pointer from x1,y1 to x2,y2 with the relevant mousebutton held down. The co-ordinates are relative to the current active window.

.topic 51
 Select the Routine command to declare a routine in the script.

.topic 52
Executes a given program and proceeds to the next line of the script. N.B. The program to run and the working directory are separated by a comma ','. The working directory is optional.

>>>>> N.B. Because the '\' character is special you must use '\\' when specifying paths! <<<<<

e.g.
Run, notepad.exe, C:\\WINDOWS
Run, C:\\Program Files\\Microsoft Office\\Office\\WinWord.exe

The first command runs notepad and sets the working directory to "C:\WINDOWS".
The second command runs MS Word in the current directory.

You can also run command interpreter commands line Echo, Copy, etc.

e.g.
Run, COMMAND.COM /C Echo Hello > C:\\Hello.txt
OR
Run, %COMSPEC% /C Echo Hello > C:\\Hello.txt

Creates a file called C:\Hello.txt containing the word "Hello".

.topic 53
Same as the Run command but waits for the program to finish before continuing.

Will also set the variable %ERRORLEVEL% to the return code of the program.

.topic 54
Sends a set of keystrokes to the currently active window. (The syntax of these keystrokes can be found in the following section).

The "Send" command syntax is similar to that of ScriptIt and the Visual Basic "SendKeys" command. Characters are sent as written with the exception of the following characters:

'!'
This tells AutoIt to send an ALT keystroke, therefore "Send,This is text!a" would send the keys "This is text" and then press "ALT+a".

N.B. Some programs are very choosy about capital letters and ALT keys, i.e. "!A" is different to "!a". The first says ALT+SHIFT+A, the second is ALT+a. If in doubt, use lowercase!

'+'
This tells AutoIt to send a SHIFT keystroke, therefore "Send,Hell+o" would send the text "HellO". "Send,!+a" would send "ALT+SHIFT+a".

'^'
This tells AutoIt to send a CONTROL keystroke, therefore "Send,^!a" would send "CTRL+ALT+a".

N.B. Some programs are very choosy about capital letters and CTRL keys, i.e. "^A" is different to "^a". The first says CTRL+SHIFT+A, the second is CTRL+a. If in doubt, use lowercase!

'#'
The hash is used as a key delimiter to make a line easier to read. i.e. "Send, H#e#l#l#o" is the same as "Send,Hello".

Certain special keys can be sent and should be enclosed in braces:

Send 	Command		Resulting Keypress
{!}					!
{#}					#
{+}					+
{^}					^
{{}					{
{}}					}
{SPACE}				SPACE
{ENTER}				ENTER
{ALT}					ALT
{BACKSPACE} or {BS}		BACKSPACE
{DELETE} or {DEL}			DELETE
{UP}					Cursor up
{DOWN}				Cursor down
{LEFT}				Cursor left
{RIGHT}				Cursor right
{HOME}				HOME
{END}					END
{ESCAPE} or {ESC}			ESCAPE
{INSERT} or {INS}			INS
{PGUP}				PGUP
{PGDN}				PGDN
{F1} - {F12}				Function keys
{TAB}					TAB
{PRINTSCREEN}			PRINTSCR
{LWIN}				Left Windows key
{RWIN}				Right Windows key
{NUMLOCK}			NUMLOCK
{CTRLBREAK}			Ctrl+break
{PAUSE}				PAUSE
{CAPSLOCK}			CAPSLOCK
{NUMPAD0} - {NUMPAD 9}	Numpad digits
{NUMPADMULT}			Numpad Multiply
{NUMPADADD}			Numpad Add
{NUMPADSUB}			Numpad Subtract
{NUMPADDIV}			Numpad Divide
{NUMPADDOT}			Numpad period
{APPSKEY}				Windows App key
{ALTDOWN}				Holds the ALT key down until {ALTUP} is sent
{SHIFTDOWN}			Holds the SHIFT key down until {SHIFTUP} is sent
{CTRLDOWN}			Holds the CTRL key down until {CTRLUP} is sent
{ASC nnnn}				Send the ALT+nnnn key combination

To send the ASCII value A (same as pressing ALT+65 on the numeric keypad)
Send, {ASC 65}

Single keys can also be repeated, e.g.
Send, {DEL 4} Presses the DEL key 4 times
Send, {S 30} Sends 30 'S' characters
Send, +{TAB 4} Presses SHIFT+TAB 4 times

.topic 55
This command will set an environment variable to the specified value.
N.B. This variable only exists within AutoIt you will not be able to access it from DOS.

e.g. To set the Env variable "ERROR" to "There has been an error":
SetEnv, ERROR, There has been an error.

To use this variable, use the percent symbol:

e.g. After running the previous command, this will output "There has been an error":
MsgBox, 1, AutoIt, %ERROR%

.topic 56
Changes the delay between keystrokes in milliseconds. Max is 32767.
Default is 20ms. 1000 milliseconds = 1 second.

.topic 57
Changes the way that window titles are matched against the script.
Valid modes are "1" and "2" - the default is "1". This mode affects most of the commands within AutoIt that have any sort of window title and text in the command, i.e. WinWait, WinWaitActive, IfWinActive, etc.

e.g.
; Script using mode 1 (default)
SetTitleMatchMode, 1

; Script using mode 2
SetTitleMatchMode, 2

mode 1:

In the script you specify the start of a window title to match. i.e. for the notepad.exe window (Untitled - Notepad), valid matches would be:
"Untitled", "Untitled -", "Unt" and "Untitled - Notepad".

mode 2:

In the script you can specify ANY substring of the window title you want to match. Again for the notepad.exe window valid matches would be:
"Untitled", "Untitled - Notepad", "Notepad", "No".

.topic 58
This changes the time that AutoIt pauses after carrying out a window related function (waiting for, minimizing, restoring, etc.) before continuing. This is useful on very slow machines, or when you have things like window animation enabled. The default is 500 milliseconds.

e.g.
SetWinDelay, 2000
Run, Notepad.exe
WinWaitActive, Untitled - Notepad
Send, Hello

In this example there would be a pause of 2000 milliseconds (2 seconds) after notepad has started until the words "Hello" appear.

.topic 59
This command allows you to perform various forms of shutdown. The type is determined by <Flag>.
The flag can be a combination from the table below:

Function							Flag
Log off the current user						0
Shutdown the workstation					1
Reboot the workstation						2
Force closing of applications (may lose unsaved work)		4
Shutdown and power off (if supported)				8

e.g. To shutdown and force applications to close without saving = Shutdown + Force = 1 + 4 = 5:
Shutdown, 5

.topic 60
Halts execution of the script for the given number of milliseconds. Max is 32767.
1000 milliseconds = 1 second.

.topic 61
Removes the splash text screen from view.

.topic 62
This command brings up a window the specified message and title. The window stays topmost without interfering with windows behind it. Useful for automation when you can bring up a "Don't Touch" message for the user without affecting other windows.

.topic 63
StringCaseSense, On

This command will turn case sensitivity on for the commands:
    IfEqual
    IfNotEqual
    IfInString
    IfNotInString
    StringReplace

.topic 64
StringCaseSense, Off

This command will turn case sensitivity off for the commands:
    IfEqual
    IfNotEqual
    IfInString
    IfNotInString
    StringReplace

.topic 65
StringLeft,<output variable>, <input variable>, <number of chars to extract>

This command takes the contents of <input variable>, extracts a number of characters and places the results in <output variable>.

*Extracts the leftmost characters from input variable.

.topic 66
StringLen,  <output variable>, <input variable>

This command takes the contents of <input variable> and puts the number of characters in the string into <output variable>.

.topic 67
StringMid, <output variable>, <input variable>, <start char>, <number of chars to extract>

This command takes the contents of <Input variable>, extract a number of characters starting from <start char> and place the result in <output variable>.

.topic 68
StringReplace, <output variab le>, <input variable>, <search string>, <replace string>

This command will search for the <search string> in the contents of the variable <input variable>. The search string will be replaced by <replace string> and the result will be placed in the <output variable>. If the search string cannot be found, the contents of <output variable> will be the same as <input variable>.

.topic 69
StringRight,<output variable>, <input variable>, <number of chars to extract>

This command takes the contents of <input variable>, extracts a number of characters and places the results in <output variable>.

*Extracts the rightmost characters from input variable.

.topic 70
StringTrimLeft, <output variable>, <inpur variable>, <number of characters to trim>

This command takes the contents of <input variable>, trims a number of characters and places the result in <output variable>

*Trims the leftmost characters

.topic 71
StringTrimRight, <output variable>, <inpur variable>, <number of characters to trim>

This command takes the contents of <input variable>, trims a number of characters and places the result in <output variable>

*Trims the rightmost characters

.topic 72
If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<

.topic 73
If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<

.topic 74
This command gets the title of the active window and puts it in the DOS variable <Variable>

e.g.
Sleep, 2000
WinGetActiveTitle, myvar
MsgBox, 0, AutoIt, The active window was %myvar%

.topic 75
If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<

.topic 76
Similar to WinClose, but if the window has not closed after a couple of seconds (Asking to save, crashed, etc.) the window will be forcibly terminated.

.topic 77
If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<

.topic 78
If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<

.topic 79
Simply, this command minimizes all windows.

.topic 80
If the window in Title and Text exists, it is moved to <X>, <Y> and resized to <Width>, <Height>

e.g.

Run, notepad.exe
WinWaitActive, Untitled - Notepad
WinMove, Untitled - Notepad,, 0, 0, 100, 100

This moves the notepad window to 0,0 and changes the size of the window to 100,100

Remember to include the comma if you don't specify Window text. "default" can be used in place of Width and Height if you don't want to change the size of the window

e.g.
WinMove, Untitled - Notepad,, 0, 0, default, default

.topic 81
If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<

.topic 82
Use this command to rename a window.

e.g.
Run, notepad.exe
WinWaitActive, Untitled - Notepad
WinSetTitle, Untitled - Notepad,, Renamed Notepad!

.topic 83
If the window exists, the relevant command (i.e. minimizing, hiding, activating, etc.) will be performed.
>> N.B. WinActivate will bring a window to the top even under Win98/NT2000.<<

.topic 84
Stops script execution until the specified window exists. The window does not need be active.

If specified the "Timeout" is in seconds. After the line has executed the Env variable %ERRORLEVEL% will be set to 0 if the function completed normally, or 1 if the wait timed out. The maximum value of Timeout is 32767 seconds.

e.g. Wait forever for the notepad window
WinWait, Untitled - Notepad

e.g. Wait for five seconds for the notepad window
WinWait, Untitled - Notepad,, 5

.topic 85
Stops script execution until the specified window to exists and is active.

If specified the "Timeout" is in seconds. After the line has executed the Env variable %ERRORLEVEL% will be set to 0 if the function completed normally, or 1 if the wait timed out.

.topic 86
Stops script execution until the specified window ceases to exist.
If specified the "Timeout" is in seconds. After the line has executed the Env variable %ERRORLEVEL% will be set to 0 if the function completed normally, or 1 if the wait timed out.

e.g.
WinWaitClose, Untitled - Notepad

.topic 87
Stops script execution until the specified window ceases to be active.
If specified the "Timeout" is in seconds. After the line has executed the Env variable %ERRORLEVEL% will be set to 0 if the function completed normally, or 1 if the wait timed out.