0% found this document useful (0 votes)
489 views

Autoit Brief Information and Cheat Sheet: Installation Hints

This document provides an overview of AutoIt, including information about installation, language comparisons to other languages, types of functions in AutoIt, and references. It also includes a list of some helpful AutoIt commands with descriptions and examples, such as functions for creating GUI windows, displaying message boxes, searching arrays, and manipulating strings. The document was written by Becky Yoose and provides an introduction to using AutoIt for automating tasks.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
489 views

Autoit Brief Information and Cheat Sheet: Installation Hints

This document provides an overview of AutoIt, including information about installation, language comparisons to other languages, types of functions in AutoIt, and references. It also includes a list of some helpful AutoIt commands with descriptions and examples, such as functions for creating GUI windows, displaying message boxes, searching arrays, and manipulating strings. The document was written by Becky Yoose and provides an introduction to using AutoIt for automating tasks.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

AutoIt Brief Information and Cheat Sheet

Installation hints
Default action when double clicking on .au3 files Run script Type of install Full Version 3.3.0.0 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 Files\AutoIt3. 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.

Language comparisons
Variables Comment Sending text Functions OML Abc1 (declare as $%&) hi mom CS.InsertText sheep Function name(name) name = value End Function (also sub) n/a Clipboard.GetText (PutText) MsgBox Text" Array(0) = A Array(1) = U AutoIt $Abc_1 ;hi mom Send(sheep) Func name (name) Return $value EndFunc Sleep() ClipGet(), ClipPut() MsgBox(0, title, text) $Array[0]="A" $Array[1]="U" Notes: Logic and Operator statements are similar between the two languages as well AutoIt only has one datatype - variant - that can contain string or numeric data.

Script pause Copy/paste Message boxes Arrays

Types of Functions in AutoIt


Built-in Ex.: Send User defined functions (UDF) Ex.: #include <array.au3> _ArrayDisplay($myArray) Declare your own Func () EndFunc or Create your own library (#include <mine.au3>)

Caveats
Speed o Millennium will be slower than the script. WinWaitActive and Sleep will help with timing, but be prepared to spend time getting the timing down. Windows o The script cannot read some of the text in the Millennium window. Selecting and copying window text or determining pixels patterns will help determine window text.

References
AutoIt homepage o http://www.autoitscript.com/autoit3/ Scripts Using AutoIt by Harvey E. Hahn o http://research.ahml.info/oml/AutoIt.html Automating Millennium and telnet tasks using Windows-based Scripting - Christina Hennessey o http://www.lmu.edu/Page39671.aspx IUG scripts page - Alan Brown o http://www.burysac.org.uk/iug.php AutoIt v3: Your Quick Guide, by Andy Flesner (OReilly Media, 2007) o http://oreilly.com/catalog/9780596515126/
Becky Yoose [email protected]

AutoIt Brief Information and Cheat Sheet


Some helpful commands (from the AutoIt help file)
Function Name _ArrayDisplay What does it do? Displays given 1D or 2D array array in a listview. Finds an entry within a 1D or 2D array. Similar to _ArrayBinarySearch(), except that the array does not need to be sorted. Create a GUI window. Displays an input box to ask the user to enter a string. Displays a simple message box with optional timeout. Sends simulated keystrokes to the active window. Pause script execution. Checks if a string contains a given substring. Returns a number of characters from the left-hand side of a string. Returns the number of characters in a string. Replace text in a string based on regular expressions. Splits up a string into substrings depending on the given delimiters. Strips the white space in a string. Trims a number of characters from the left hand side of a string. Returns the size of array dimensions. Activates (gives focus to) a window. Closes a window. Checks to see if a specified window exists. Pauses execution of the script until the requested window is active. Example _ArrayDisplay($Array, "Array title") $Index = _ArraySearch($Array, keyword, 0, 0, 0, 1) $pic = GUICreate("", 169, 68, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $gui) $passwd = InputBox("Security Check", "Enter your password.", "", "*") MsgBox(0, "Test", "This box will time out in 10 seconds", 10) Send("Today's date is 9/25/09") Sleep(5000) ;five seconds $result = StringInStr("I am a String", "ring") $result = StringLeft("I am a string", 3) $len = StringLen("How long am I?") StringRegExpReplace("Where have all the flowers gone, long time passing?", "[aeiou]", "@") $days = StringSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",") $text = StringStripWS(" this is a line of text ", 3) $result = StringTrimLeft("I am a string", 3) $rows = UBound($myArray) WinActivate("Notepad", "") WinClose ("Notepad", "") If WinExists("Untitled -") Then MsgBox(0, "", "Window exists") EndIf WinWaitActive("Untitled")

_ArraySearch

GUICreate InputBox MsgBox Send Sleep StringInStr StringLeft StringLen StringRegExpReplace

StringSplit StringStripWS StringTrimLeft UBound WinActivate WinClose WinExists WinWaitActive

Becky Yoose [email protected]

You might also like