SET
Top  Previous  Next

SET <!VAR1> <value>
SET <BuiltInVAR> <value>

   
This command sets the variable !VAR1, !VAR2 or !VAR3 or one of the built-in variables to a certain value. Note: This command can be used with variables !VAR1, !VAR2 or !VAR3 or one of the built-in variables, but not with the dynamically generated variables from the "-var_X" command.

Available built-in variables:

Note: Built-in variables start with an exclamation mark (like !LOOP) and are all caps. Variables that you create via the command line or the Scripting Interface do not have an exclamation mark and are not case sensitive, which means, for example, that {{MyID}} is the same as {{myid}}.

!DATASOURCE Input file for merging data
with macro. Example: SET !DATASOURCE c:\mysource.txt.

!DIALOGMANAGER (YES/NO) Activate or stop the Dialog Manager. Example: If you want your users to handle the print dialog manually, you can use SET !DIALOGMANAGER NO before the PRINT command.

!ERRORMACRO Overrides the global error macro setting in the option dialog for the current macro.

!ERRORCONTINUE (YES/NO) Tells IM to ignore errors that can be safely ignored, for example, TAG commands that are not found on the Web page. If you set this parameter to YES, the "LoadCheck" is automatically disabled as well.

!ENCRYPTION (NO/STOREDKEY/TMPKEY) Can be used to disable the use of password encryption for the current macro. Applies only to password fields on a Web page. (Password fields are the ones where words are displayed using asterisks ****).

!EXTRACT Contains the extraction results. Can be used as variable or stored in another variable. After {{!EXTRACT}} is used once, the content is reset. If you want to use it in more than one place, assign it to a variable first. Example: SET !VAR1 {{!EXTRACT}}

!EXTRACTADD Adds (appends) a value to the extraction results. This new value is separated by [EXTRACT] tag from previous extraction results, just as normal extraction results. Adding a specific value or variable to the extraction results is often useful if you want to add an input parameter (for example a search keyword that you read from a CSV list) to our output file of extraction results. Example: SET {{!EXTRACTADD}} {{my_input_value}}. Instead of using !EXTRACTADD, you can also use ADD {{!EXTRACT}}

!EXTRACTDIALOG
(YES/NO) Extract information from a dialog. The text of a website dialog is extracted. The text is processed the same way as standard EXTRACT text. To enable this feature, simply add manually "SET !EXTRACTDIALOG YES" to your macro.

!EXTRACT_TEST_POPUP (YES/NO). Set this value to NO to disable the extract testing popup that appears by default if you run a macro with an extract popup directly and not by using the command line or scripting interface.

!FILESTOPWATCH Sets the file name for the file that contains the stopwatch measurement data. By default the file name is "stopwatch.csv" and is located in the download directory. You can use a name or a fully qualified path name. Example: SET !FILESTOPWATCH mynewfile.txt, SET !FILESTOPWATCH NO instructs IIM not to create a response time log file.

!IMAGEX This value contains the X-coordinate of the last image found with the IMAGESEARCH or IMAGECLICK command.

!IMAGEY This value contains the Y-coordinate of the last image found with the IMAGESEARCH or IMAGECLICK command.

!FILELOG Sets a specific log file name for the current macro. If only a name ("mylog.txt") and no path information (e.g. "c:\folder\mylog.txt") is given, the information is logged to the /DOWNLOAD directory. If no FILELOG command is used, all information is logged to the main log file specified in the Options dialog.

!FOLDERIMACROS Returns the folder from which the "imacros.exe" file was started ("Application Path"). This path can be useful if you run use iMacros with local web pages (Offline Mode) and you need a relative path. Example: URL GOTO=file:///{{!FOLDERIMACROS}}/local/test.htm.

!NOW:yyyymmdd Inserts the current date and time.

!LOADCHECK YES/NO: Switch the "LoadCheck" for completely loaded complex web sites to NO which is OFF. See for example Demo-FillVariousWebsites. The "LoadCheck" value is automatically 1/10th of the timeout value. The Timeout default value is 60s, thus the LoadCheck default value is 6s. LoadCheck runs if a TAG line is not found. Before a TAG error occurs, iMacros does some additional checks to make sure the TAG line is really not found. Typically, this check is required only for complex pages with frames and Javascript and pages that reload themselves. If you set !ERRORIGNORE YES the LoadCheck is automatically switched off.

!LOOP Counts the current loop in loop mode. Especially useful together with the POS=... attribute of the TAG command. See an example in the "Demo-Slideshow" macro. With SET !LOOP 3 you can set a start value for the loop counter (the default value is 1). This is useful when you use the {{loop}} variable inside you macro and want to start with a value different from 1. SET !LOOP is ignored for every loop run except the first one.

!POINTER (YES/NO) Disables or enables the pointer (blue frame) that marks the current position during a macro replay. For example, the pointer can be switched off for unattended operations where nobody watches the macro. Also, disabling the pointer can be useful to avoid losing the focus from iMacros screen. This can be necessary if you want to manually continue typing in fields without taking your hands off the keyboard while the macro is playing (e.g. during a WAIT statement).

!REPLAYSPEED (FAST/MEDIUM/SLOW) Set the replay speed to fast(1), medium(2) or slow(3). Fast replay speed means there is no delay between each step, "medium" is a 1 second delay and "slow" waits 2 seconds between each command. This command overrides the global replay speed setting in the options dialog.

!STOPWATCHTIME Contains the last measured response time value.

!TIMEOUT New timeout value in seconds. Overrides the Internet macro default value. Example: SET !TIMEOUT 150 . The "LoadCheck" value is automatically 1/6th of the timeout value. The default timeout is 60s.

!URLSTART The URL that was active in the browser when the macro started. Typically used to go back to the start page inside the macro.

!URLCURRENT Contains the current URL. This is the URL visible in the browser address bar at the time the variable is used.

!VARDEFAULT Sets the value of allundefined variables to <value>. This can be helpful for debugging a macro that it is normally used via the command line or Scripting Interface and contains many variables. With VARDEFAULT active, you can avoid the "variable not defined" errors when running the macro manually for test purposes. If <value> is empty, the VARDEFAULT command is ignored.





Page URL http://www.iopus.com/imacros/help/set.htm