Getting started with autoit

Download autoit eBook

Remarks

AutoIt is a lightweight freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting.

It is especially useful for generating keystrokes and reading information from native Windows controls. Library functions are included for the automation of Microsoft Office applications and web browsers.

It can be downloaded from https://www.autoitscript.com/site/autoit/, a site which also contains a comprehensive documentation set.

Hello World

A simple AutoIt script showing some of the basic features of the language.
Note that semicolons introduce comments
Save this as "HelloWorld.au3"

; Include constants.  In this case, for the MsgBox() function
#include <MsgBoxConstants.au3>

; Define and initialize the title of a dialogue box
; All AutoIt variables are loosely typed
; Local specifies the scope
Local $title
$title = "Example Window"

; Alternative method of implicit definition
; This time also indicating constant
Const $text = "Hello World"

; Third example definition
; Strings and integers defined in the same manner
$timeout = 30

; Create dialogue box using #included constants
MsgBox($MB_ICONINFORMATION, $title, $text, $timeout)

; Program end - Use of Exit is not mandatory
Exit
 

This will produce a simple output:-
Hello World output

Installation or Setup

AutoIt is intended for use on the Microsoft Windows operating system. It is compatible with versions from Windows XP onwards.

Download the installation utility from https://www.autoitscript.com/site/autoit/downloads/

If installing on a 64-bit version of Windows, the user is prompted to choose a 64- or 32-bit installation. The choice affects the compilation utilities that are installed alongside the script interpreter.

The installation utility will install into the given directory:

  • The script interpreter
  • A script compiler
  • A script editor (SciTE)
  • Help files
  • Examples

Stats

27 Contributors: 3
Tuesday, December 20, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook