Apart from the concept of windows and keystrokes, AutoIt v3 is quite different to v2.64 and previous versions of AutoIt. v2.64 will continue to be available for download and there are few reasons why users should try and convert existing scripts (if it ain't broke, etc.). However v3 has lots of great new features to make GUI automation easier than ever before, as well as being a much better general purpose scripting language.
When start to use v3 the following should help to make things a little easier. There is also a v2.64 to v3 script converter available in the "Extra" directory which is located in the installation directory.
- Backslashes are no longer a special character. However, quotation marks
are a new issue....
For example, Run('C:\Windows\Notepad.exe "C:\Some
File.txt" ')
- Command-Line Syntax:
There is only script mode, i.e., AutoIt.exe <filename
of script file>
- Conventions:
<cmd>, <parameter1> [,<parameter2>]
has been replaced with Cmd(parm1 [,parm2])
- Goto does not exist due to the support of loops and user-defined functions.
- AutoItv3 supports variables like most programming languages: $myVar
= "Example of assignment"
- Scripts have the extension .au3 instead of .aut
If you wish to re-write version 2.64 scripts as version 3, the following table
may help you:
Version 2.64 function | Version 3 equivalent |
AdlibOn | AdlibEnable |
BlockInput | BlockInput |
Break | Break |
DetectHiddenText | AutoItSetOption("WinDetectHiddenText",...) |
Exit | Exit |
EnvAdd | [see + operator] |
EnvDiv | [see / operator] |
EnvMult | [see * operator] |
EnvSub | [see - operator] |
FileAppend | [FileOpen(...,2) followed by FileWriteLine] |
FileCopy | FileCopy |
FileCreateDir | DirCreate |
FileDelete | FileDelete or FileRecycle |
FileInstall | FileInstall |
FileReadLine | FileReadLine |
FileRemoveDir | DirRemove |
FileSelectFile | FileOpenDialog or FileSaveDialog |
Gosub | [see Func...EndFunc] |
Return | [see Func...EndFunc] |
Goto | [not needed] |
HideAutoItDebug | -- |
HideAutoItWin | AutoItSetOption("TrayIconHide",...) |
IfInString | If StringInStr(...) Then |
IfNotInString | If Not StringInStr(...) Then |
IfWinExist | If WinExists(...) Then |
IfWinNotExist | If Not WinExists(...) Then |
IfWinActive | If WinActive(...) Then |
IfWinNotActive | If Not WinActive(...) Then |
IfEqual | [see = and == operators] |
IfNotEqual | [see <> operator] |
IfGreater | [see > operator] |
IfGreaterOrEqual | [see >= operator] |
IfLess | [see < operator] |
IfLessOrEqual | [see <= operator] |
IfExist | FileExists |
IfNotExist | If Not FileExists(...) Then |
IfMsgBox | [see MsgBox(...) and Select...Case...EndSelect] |
IniRead | IniRead |
IniWrite | IniWrite |
IniDelete | IniDelete |
InputBox | InputBox |
LeftClick | MouseClick("left",...) |
RightClick | MouseClick("right",...) |
LeftClickDrag | MouseClickDrag("left",...) |
RightClickDrag | MouseClickDrag("right",...) |
MouseGetPos | MouseGetPos |
MouseMove | MouseMove |
MsgBox | MsgBox |
Random | Random |
RegRead | RegRead |
RegWrite | RegWrite |
RegDelete | RegDelete |
Repeat | [see For...Next] |
EndRepeat | [see For...Next] |
Run | Run |
RunWait | RunWait |
Send | Send |
SetCapslockState | SendSetCapslockState |
SetEnv | EnvSet |
SetBatchLines | -- |
SetKeyDelay | AutoItSetOption("SendKeyDelay",...) |
SetStoreCapslockMode | AutoItSetOption("SendCapslockMode",...) |
SetTitleMatchMode | AutoItSetOption("WinTitleMatchMode",...) |
SetWinDelay | AutoItSetOption("WinWaitDelay",...) |
Shutdown | Shutdown |
Sleep | Sleep |
SplashTextOn | SplashTextOn and others |
SplashTextOff | SplashOff |
StringCaseSense | [see individual functions] |
StringLeft | StringLeft |
StringRight | StringRight |
StringMid | StringMid |
StringLen | StringLen |
StringReplace | StringReplace |
StringTrimLeft | StringTrimLeft |
StringTrimRight | StringTrimRight |
StringGetPos | StringInStr |
WinGetActiveStats | [see WinGetPos, WinGetTitle, WinGetText] |
WinGetActiveTitle | WinGetTitle("") |
WinKill | WinKill |
WinWait | WinWait |
WinWaitClose | WinWaitClose |
WinWaitActive | WinWaitActive |
WinWaitNotActive | WinWaitNotActive |
WinHide | WinSetState(..., @SW_HIDE) |
WinShow | WinSetState(..., @SW_SHOW) |
WinRestore | WinSetState(...,@SW_RESTORE) |
WinMinimize | WinSetState(...,@SW_MINIMIZE) |
WinMaximize | WinSetState(...,@SW_MAXIMIZE) |
WinActivate | WinActivate |
WinClose | WinClose |
WinMove | WinMove |
WinSetTitle | WinSetTitle |
WinMinimizeAll | WinMinimizeAll |
WinMinimizeAllUndo | WinMinimizeAllUndo |
#Include | #Include |
%CLIPBOARD% | [see ClipGet and ClipPut] |
A_OSTYPE | @OSType |
A_OSVERSION | @OSVersion |
A_SCRIPTNAME | @ScriptName |
A_SCRIPTDIR | @ScriptDir |
A_SCRIPTFULLPATH | @ScriptFullPath |
A_WORKINGDIR | @WorkingDir |
A_NUMBATCHLINES | -- |
A_SEC | @SEC |
A_MIN | @MIN |
A_HOUR | @HOUR |
A_MDAY | @MDAY |
A_MON | @MON |
A_YEAR | @YEAR |
A_WDAY | @WDAY |
A_YDAY | @YDAY |