Macro Commands
This page lists all available iMacros commands. For the more complex commands, links lead to more detailed explanations and sample macros. For Scripting Interface commands please see the Automation section of this manual.
'
' indicates a comment. If a line starts with " ' " everything behind the " ' " is ignored. Typically this is used for comments or to disable specific parts of a macro. The macro can not have empty lines, as an empty line indicates the end of the macro. So every line in the macro must have at least the comment symbol.
ADD !VAR1 value
Add a value to !VAR1. The ADD command supports the built-in variables !VAR1, !VAR2, !VAR3 and !EXTRACT.
Note: Double-brackets are used around a variable when you mean the value of the variable. No brackets are used when you mean the variable itself. Thus ADD !VAR1 {{!LOOP}} means: Add the value of the !LOOP variable to the variable !VAR1.
BACK
Goes BACK one step.
CLEAR
Clears browser cache AND cookies. Can be useful, for example, to delete Web site cookies so every macro run starts at the some point.
CLICK X=123 Y=111 CONTENT=ABC
"Clicks" on the element at the specified X/Y coordinates. In contrast to WINCLICK, this click can be run in background mode. The optional CONTENT= attribute can be used to send text to the clicked element (e.g. if the clicked element is an input box)
CMDLINE <!VAR> <default value>
Sets the variable to a value retrieved from the command line. Use the-var1, -var2 and -var3 switches to set the variables from the command line.
DISCONNECT
Disconnects the current dial-up connection. Tip: On Dial-Up connections DISCONNECT and REDIAL can be used to change IP addresses.
EXTRACT POS=1 TYPE=TXT(or "HREF" or "TITLE" or "ALT") ATTR=<X>:(Anchor*)
Extracts data from websites. Please note that the anchor normally ends with "*". <X> is the number of the parent element the anchor refers to. In most cases no parent element is used. Then this value is "0" and not displayed.
To extract the URL address of a link (e.g. http://www.InternetMacros.com) instead of the name ("iMacros") use TYPE=HREF instead of TYPE=TXT. "TITLE" will extract a page element title (if the element has one, do not confuse this with the page title). "ALT" extracts the "ALTernate" text for an image.
FILEDELETE NAME=abc.csv
Deletes file with name "abc.csv". For example, this can be used to delete an old extraction file to avoid appending extraction results.
FRAME F=<value>
Directs all following TAG or EXTRACT commands to the specified frame. The frame tag and number is automatically generated by clicking into a framed web page. Example macro: "Demo-Frames.iim"
IMAGECLICK IMAGE=<abc.bmp> CONFIDENCE=<value> CONTENT=<text>
Sends a WINCLICK command to the specified image. Image is searched using image recognition algorithms. CONFIDENCE specifies how close the found image must match the input image. A value of 100 means exact match. This command is only available if the Image Recognition Plugin is installed.
IMAGESEARCH IMAGE=<abc.bmp> CONFIDENCE=<value>
Searches for the image using image recognition algorithms. CONFIDENCE specifies how close the found image must match the input image. A value of 100 means exact match. This command is only available if the Image Recognition Plugin is installed.
ONCERTIFICATEDIALOG C= 1
Dialog Manager command for handling certificate selection dialogs.
ONDIALOG POS= 1 BUTTON=OK CONTENT=
Instructs the Dialog Manager to click the [OK] button for the next dialog. This settings remains valid until changed with another "ONDIALOG" command.
ONDOWNLOAD FOLDER=* FILE=+_{{!NOW:yyyymmdd_hhnnss}}
Dialog Manager command for handling the download dialog.
ONERRORDIALOG BUTTON=YES/NO CONTINUE=YES/NO
Dialog Manager command for handling error dialogs.
ONLOGIN USER=... PASSWORD=...
Dialog Manager command for handling login dialogs.
ONSECURITYDIALOG BUTTON=YES/NO CONTINUE=YES/NO
Dialog Manager command for handling security dialogs.
ONWEBPAGEDIALOG KEYS=hello<TAB>world<ENTER><CLOSE>
Dialog Manager command for handling web page dialogs.
PRINT
Prints the current browser window.
Tip: If you want to print PDF files with the Acrobat Reader Plug-In, you need to add a "ONDIALOG POS=1 BUTTON=OK" command before the PRINT statement.
PROMPT <Text> <!VAR> <default value>
Displays a popup to ask for a value. This value is stored in the variable.
Note: This command can be used with variables !VAR1, !VAR2 or !VAR3, but not with built-in variables like !DATASOURCE or dynamically generated variables from the "-var_X" command.
PROXY ADDRESS=<ip>:<port> BYPASS=<local>
Connect to a proxy server to run the current macro.
REDIAL YourISP
Redials a connection. "YourISP" is the name of your dialup connection as it appears in the Windows dialup selection.
REFRESH
Refreshes (Reloads) current browser window. Refresh includes sending a "pragma:nocache" header to the server (HTTP URLs only).
SAVEAS TYPE=CPL/MHT/HTM/TXT/EXTRACT/BMP FOLDER=* FILE=+_{{!NOW:yyyymmdd_hhnnss}}
Saves information to a file. Please see the SAVEAS page for more details on the different SAVEAS types.
SET <!VAR> <value>
This command sets the variable !VAR1, !VAR2 or !VAR3 or one of the built-in variables to a certain value.
SIZE X=730 Y=655
Resizes the IM Browser Window (width, height in pixels). In Internet Explorer, this command is ignored. [PRO and SCRIPTING Editions only].
STOPWATCH ID=MyName
Web site response time measurement. By default, the measured data is stored in the download directory of iMacros. You can change the file location with the !FILESTOPWATCH variable. [PRO and SCRIPTING Editions only].
TAB T=<X>
Switches to Tab number <x>.
TAB CLOSE
Closes the currently active tab.
TAB CLOSEALLOTHERS
Closes all tabs except the currently active one.
TAB OPEN
Opens a new tab.
TAG - Selects a web page element.
URL GOTO=http://www.iOpus.com
Navigates to a URL .
WAIT SECONDS=33
Waits (s) seconds.
WAIT SECONDS=#DOWNLOADCOMPLETE#
In some situations it can be necessary to wait, not for a specific time but rather until the browser is completed with a page load. Note that in most cases iMacros knows automatically when to wait. But this statement can be useful inside complex web pages that contain, for example, Javascript code that loads a new page automatically.
VERSION BUILD=4213805
Version that created this macro. Example: 421805 corresponds to Version 4.21 (Build 805).
WINCLICK X=123 Y=111 CONTENT=Hello<SP>World
Triggers a "real" Windows click in the browser window. The advantage of this command is that it works with EVERY web page, even Java or Flash elements where the standard CLICK command fails. The CONTENT= attribute can be used to send text to the clicked element (e.g. if the clicked element is an input box) [PRO and SCRIPTING Editions only].
Page URL http://www.iopus.com/imacros/help/commands_overview.htm