Command Reference

From iMacros
Revision as of 16:54, 21 April 2007 by Hm (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

iMacros Commands Reference

Macro Commands

This page lists all available iMacros commands. Each command has either zero or more parameters. If parameters can be omitted, they are enclosed by square brackets. If several choices are possible for the same parameter, they appear in brackets and are seperated by the | character. Integer numbers are denoted by the letters n or m, all other name denote a series of characters (strings). For Scripting Interface commands please look here.


'     

The ' character 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.


Note: A macro cannot 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 result_var added_value    

Adds a value to a variable.

BACK     

Opens the previously visited webpage.

CLEAR 

Clears browser cache and cookies on the harddrive.

CLICK X=n Y=m [CONTENT=some_content]    

"Clicks" on the element at the specified X/Y coordinates.

CMDLINE variable default_value     

Sets the variable to a value retrieved from the command line.

DISCONNECT 

Disconnects the current dial-up connection.

EXTRACT POS=[R]n TYPE=(TXT|HREF|TITLE|ALT) ATTR=Anchor*  

Extracts data from websites.

FILEDELETE NAME=file_name  

Deletes a file.

FILTER TYPE=IMAGES STATUS=(ON|OFF) 

Filters web site elements. Currently the support for filtering is experimental. If you need any other data filtered, please let us know what kind of filter you would like to see added.

FRAME F=n  

Directs all following TAG or EXTRACT commands to the specified frame.

IMAGECLICK IMAGE=image_file CONFIDENCE=n [CONTENT=some_content] 

Sends a WINCLICK command to the specified image.

IMAGESEARCH IMAGE=image_file CONFIDENCE=n  

Searches for the the input image specified via the IMAGE attribute.

ONCERTIFICATEDIALOG C=n     

Selects the client side certificate from a dialog.

ONDIALOG POS=n BUTTON=(YES|NO|CANCEL) [CONTENT=some_content]    

Handles JavaScript dialogs.

ONDOWNLOAD FOLDER=folder_name FILE=file_name    

Handles download dialogs.

ONERRORDIALOG BUTTON=(YES|NO) CONTINUE=(YES|NO)    

Handles error dialogs.

ONLOGIN USER=username PASSWORD=password    

Handles login dialogs.

ONSECURITYDIALOG BUTTON=(YES|NO) CONTINUE=(YES|NO)    

Handles security dialogs.

ONWEBPAGEDIALOG KEYS=some_keys    

Handles web page dialogs.

PRINT 

Prints the current browser window.

PROMPT prompt_text variable_name [default_value] 

Displays a popup to ask for a value. This value is stored in the variable.

PROXY ADDRESS=proxy_URL:port [BYPASS=page_name] 

Connects to a proxy server to run the current macro.

REDIAL ISP  

Redials a connection.

REFRESH     

Refreshes (Reloads) current browser window.

SAVEAS TYPE=(CPL|MHT|HTM|TXT|EXTRACT|BMP) FOLDER=folder_name FILE=file_name 

Saves information to a file.


SET variable_name variable_value    

Assigns values to built-in variables.


SIZE X=n Y=m     

Resizes the iMacros Browser Window.

STOPWATCH ID=id     

Measures time between two STOPWATCH commands.

TAB T=(n|OPEN|CLOSE|CLOSEALLOTHERS) 

Sets focus on the tab with number n.

TAG POS=n TYPE=type [FORM=form] ATTR=attr [CONTENT=some_content] 

Selects a webpage element.

URL GOTO=some_URL 

Navigates to a URL in the currently active tab.

VERSION BUILD=4213805  

Specifies the version of iMacros that created this macro.

WAIT SECONDS=(n|#DOWNLOADCOMPLETE#) 

Waits for a specific time.

WINCLICK X=n Y=n [CONTENT=some_content] 

Sends standard mouse clicks within the browser window to the specified coordinates [PRO and SCRIPTING Editions only].

ADD

Add a value to a variable. You can also substract values by adding a negative value to the variable. If the content of at least one of the variables is not numeric, the values are concatenated as strings instead. The ADD command supports the built-in variables !VAR1, !VAR2, !VAR3 and !EXTRACT.

Syntax

ADD result_var added_value 

Parameters

result_var 

One of the four built-in variables !VAR1, !VAR2, !VAR3 or !EXTRACT. After the ADD command, this variable will hold the result.

added_value 

The value that will be added to result_var


Examples

Both values are numeric, therefore the result is numeric as well:

SET !VAR1 100 
ADD !VAR1 -20 

=> Content of !VAR1 is 80.

At least one of the values is a string, therefore the result is a string as well:

SET !VAR1 Hello 
ADD !VAR1 <SP>World<SP> 
ADD !VAR1 2010 

=> Content of !VAR1 is Hello World 2010


See Also

SET