View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
AutoIt Brief Information and Cheat Sheet
Default action when double clicking on .au3 files – Run script
Type of install – Full
Version 220.127.116.11 is the current version. However, I have noticed that there is a bug in the help file that prevents the
index portion of the help file from populating. If they run into that problem, you may need to check to see if the
AutoIt.chw file is in C:Program FilesAutoIt3. If not, I have gotten the .chw file to pop up when I opened
AutoIt.chm, and then clicked on the Index tab. If that does not work, there are two other .chm files in that folder
(AutoIt3 and UDFs3) that could be opened.
Variables Abc1 (declare as $%&) $Abc_1 Notes:
Comment ‘hi mom ;hi mom
Sending text CS.InsertText “sheep” Send(“sheep”) Logic and Operator
Functions Function name(name) Func name (name) statements are similar
name = value Return $value between the two languages
End Function EndFunc as well
Script pause n/a Sleep(…) AutoIt only has one
Copy/paste Clipboard.GetText (PutText) ClipGet(…), ClipPut(…) datatype - variant - that can
Message boxes MsgBox “Text" MsgBox(0, “title”, “text”) contain string or numeric
Arrays Array(0) = “A” $Array="A" data.
Array(1) = “U” $Array="U"
Types of Functions in AutoIt Caveats
Built-in • Speed
Ex.: Send o Millennium will be slower than the
User defined functions (UDF) script. WinWaitActive and Sleep will
Ex.: help with timing, but be prepared to
#include <array.au3> spend time getting the timing down.
_ArrayDisplay($myArray) • “Windows”
Declare your own o The script cannot read some of the
Func (…) … EndFunc text in the Millennium window.
or Selecting and copying window text or
Create your own library determining pixels patterns will help
(#include <mine.au3>) determine window text.
• AutoIt homepage
• Scripts Using AutoIt by Harvey E. Hahn
• Automating Millennium and telnet tasks using Windows-based Scripting - Christina Hennessey
• IUG scripts page - Alan Brown
• AutoIt v3: Your Quick Guide, by Andy Flesner (O’Reilly Media, 2007)
AutoIt Brief Information and Cheat Sheet
Some helpful commands (from the AutoIt help file)
Function Name What does it do? Example
Displays given 1D or 2D array
_ArrayDisplay _ArrayDisplay($Array, "Array title")
array in a listview.
Finds an entry within a 1D or 2D
array. Similar to
$Index = _ArraySearch($Array, “keyword”,
_ArraySearch _ArrayBinarySearch(), except
0, 0, 0, 1)
that the array does not need to
$pic = GUICreate("", 169, 68, 0, 0,
GUICreate Create a GUI window.
Displays an input box to ask the $passwd = InputBox("Security Check",
user to enter a string. "Enter your password.", "", "*")
Displays a simple message box MsgBox(0, "Test", "This box will time out in
with optional timeout. 10 seconds", 10)
Sends simulated keystrokes to
Send Send("Today's date is 9/25/09")
the active window.
Sleep Pause script execution. Sleep(5000) ;five seconds
Checks if a string contains a
StringInStr $result = StringInStr("I am a String", "ring")
Returns a number of characters
StringLeft from the left-hand side of a $result = StringLeft("I am a string", 3)
Returns the number of
StringLen $len = StringLen("How long am I?")
characters in a string.
StringRegExpReplace("Where have all the
Replace text in a string based on
StringRegExpReplace flowers gone, long time passing?", "[aeiou]",
Splits up a string into substrings $days =
StringSplit depending on the given StringSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat",
$text = StringStripWS(" this is a line
StringStripWS Strips the white space in a string.
of text ", 3)
Trims a number of characters
StringTrimLeft from the left hand side of a $result = StringTrimLeft("I am a string", 3)
Returns the size of array
UBound $rows = UBound($myArray)
Activates (gives focus to) a
WinActivate WinActivate("Notepad", "")
WinClose Closes a window. WinClose ("Notepad", "")
If WinExists("Untitled -") Then
Checks to see if a specified
WinExists MsgBox(0, "", "Window exists")
Pauses execution of the script
WinWaitActive until the requested window is WinWaitActive("Untitled")