System Variables
Environment Specific Values:
OS_VER |
Operating System |
WIN_DIR |
Windows Directory Path |
SYS_DIR |
Windows System Directory Path |
SYS_NATIVE |
Native System Directory Path Bypassing 64 Bit Redirection |
TEMP_DIR |
Windows Temp Directory Path |
DESKTOP_DIR |
User's Desktop Path |
USERDOCUMENTS_DIR |
User's Documents Path |
PROGRAM_FILES |
Program Files Folder (Will be x86 folder if running on x64) |
PROGRAM_FILES_NATIVE |
Native Program Files Folder (e.g. "Program Files" not (x86) on x64) |
OS_PLATFORM |
Operating System Platform - i.e. WIN32 or WIN64 |
The above variables store their values in upper case.
USER_NAME |
Current Username |
COMPUTER_NAME |
Computer Name |
MSCHED_VER |
Macro Scheduler version number |
Runtime Variables:
SCRIPT_DIR |
Directory of running script |
SCRIPT_FILE |
Filename (full path) of running script. For compiled macro this will be the path of the .exe file |
SCRIPT_NAME |
Just the filename part of the running script/exe |
BMP_DIR |
Folder used by image recognition wizard whose full path is SCRIPT_DIR\SCRIPT_NAME. Use of BMP_DIR for storing needle image simplifies distribution of image recognition macros and runtime images. |
COMMAND_LINE |
Full command line string (path of running executable and parameters passed on the command line) |
MACRO_PARMS |
Parameters passed by Macro> command |
CWD |
Current Directory |
_LINE_NUM |
Stores the current line number being executed |
Useful printable and non-printable characters:
CR |
Carriage Return |
LF |
Line Feed |
CRLF |
Carriage Return, Line Feed Combination (to force a new line) |
TAB |
Tab character |
SPACE |
Space character |
NULLCHAR |
Null Character - Chr(0) |
DECIMAL_SEPARATOR |
Sets/retrieves the character used as the decimal separator in floating point/currency numbers. Default is "." |
THOUSAND_SEPARATOR |
Sets/retrieves the character used as the thousand separator in numbers. Default is "," |
COMMA |
, |
Directives:
The following variables are directives used to alter the behaviour of various functions. Some have default values which are given below. Some have no default value which means they are "unset" and have no effect (the default behaviour of the function as described in the function topic will occur). Once set these variables remain set for the remainder of the script or until reset/changed. For more information about each one see the topic for the command they affect.
Variable Name |
Default Value |
Description |
WW_TIMEOUT |
0 |
Timeout value from WaitWindowOpen / Closed |
WSI_TIMEOUT |
0 |
Used to set a timeout value for WaitScreenImage |
WST_TIMEOUT |
|
Used to set a timeout value for WaitScreenText |
RP_WAIT |
0 |
Switches waiting for program termination on and off in RunProgram |
RP_WINDOWMODE |
1 |
Used to set window mode for RunProgram |
RP_ADMIN |
|
Set to 1 to make RunProgram run as admin |
RP_DISPLAYERROR |
|
Allows RunProgram error messages to be turned off/on |
RP_WIN64PROCESS |
|
Set to 1 to disable 64 bit redirection to make Run Program run a process stored in the 64 bit system folder rather than the 32 bit system folder |
MSG_STAYONTOP |
0 |
Used to set message to stay on top in Message / MessageModal |
MSG_CENTERED |
|
Used to set message box to center |
MSG_WIDTH |
273 |
Used to set the width of the message box |
MSG_HEIGHT |
200 |
Used to set the height of the message box |
MSG_XPOS |
CENTER |
Used to set the X position of the message box |
MSG_YPOS |
CENTER |
Used to set the Y position of the message box |
ASK_TIMEOUT |
|
Used to set a timeout for Ask dialog |
SK_DELAY |
0 |
Millisecond delay to pause between sending characters in SendText or between repeated key presses sent with Press... |
SK_IGNORECAPS |
|
Set to 1 for Send to ignore caps lock and send characters as entered |
SK_LEGACY |
|
If Press/Release commands fail in Citrix/DOS, set this to 1 first. |
PRESS_ALLOWVARS |
|
Set to 1 to make Press/Release commands accept a variable for the key name |
RND_SEED |
Random |
Allows a seed to be set for the Random command |
CF_OVERWRITE |
0 |
Allows changing CopyFile to overwrite or rename on collision |
FTP_STATUS |
|
Used to switch off/on the FTP status window |
FTP_PASSIVE |
|
Used to toggle FTP passive mode |
FTP_TIMEOUT |
|
Timeout value for FTPGetFile/ FTPPutFile / FTPGetDirList |
FTP_USETLS |
|
Set type of TLS/SSL connection to use |
SSL_CERT |
|
Specify SSL certificate file |
SSL_ROOT_CERT |
|
Specify SSL root certificate file |
SSL_KEY |
|
Specify SSL key file |
SENDMAIL_STATUS |
|
Used to switch off/on the SMTPSendMail status window |
SMTP_AUTH |
|
Used to set SMTP authentication on or off |
SMTP_USERID |
|
Used for SMTP authentication |
SMTP_PASSWORD |
|
Used for SMTP authentication |
SMTP_RECEIPT |
|
Used to enable SMTP return receipt |
SMTP_PORT |
|
Used to optionally set the port of the SMTP server |
SMTP_CCLIST |
|
Set CC recipients for SMTPSendMail |
SMTP_BCCLIST |
|
Set BCC recipients for SMTPSendMail |
SMTP_TIMEOUT |
|
Timeout for SMTP connection (milliseconds) |
SMTP_HTMLBODY |
|
Set to 1 to send body as HTML in SMTPSendMail |
POP3_STATUS |
|
Used to switch off/on the RetrievePOP3 status window |
POP3_PORT |
|
Used to set the POP3 port (defaults to 110) |
POP3_TIMEOUT |
|
Used to set a POP3 timeout |
POP3_DELETE |
|
Used to tell RetrievePOP3 to delete messages from the server |
POP3_MSGSIZELIMIT |
|
POP3 message size limit - RetrievePOP3 ignores messages larger |
REG_INTASSTR |
|
Used to set RegistryWriteKey to write integers as strings/integers |
WF_TYPE |
1 |
Used to set the type of window the windowing functions should affect |
VBS_TIMEOUT |
|
Used to set the timeout for VBScript code |
GAW_TYPE |
0 |
Used for GetActiveWindow to set for active, or active child window. |
INPUT_PASSWORD |
|
Used to mask data entry in Input. |
MF_RENAME |
|
Set to 1 to cause MoveFile to rename instead of physically move files. |
APP_TITLE |
|
Sets the application title of compiled macros. |
WIN_USEHANDLE |
|
Set to 1 to set all window functions to use/return window handles instead of window titles. Set to 0 to set back to window titles. |
WIN_REGEX |
|
Set to 1 to use regular expressions instead of plain text for window title matching in all window functions. Default is 0 (off). |
WIN_SLEEP |
|
Set to 1 to decrease CPU usage for (but slow down) WaitWindowOpen/Closed and OnEvent WINDOW_OPEN/NOTOPEN. |
HTTP_TIMEOUT |
|
Optional timeout value for HTTPRequest |
HTTP_SSL |
|
Specify whether to use SSL or not for HTTPRequest |
STEP_DELAY |
|
Sets a millisecond delay between each script line |
CRYPT_LEVEL |
|
Sets the encryption strength for Crypt command |
GFL_TYPE |
|
Set to 1 to make GetFileList return directories only |
FIP_SCANPIXELS |
ALL |
Used to alter the number of random pixels FindImagePos scans |
WLN_NOCRLF |
|
Set to 1 to make WriteLn omit line break. |
WLN_ENCODING |
|
Set to UNICODE to make WriteLn output Unicode (anything else/default is ANSI) |
_DUMP_VARS |
|
Set to 1 to dump all variable names and values to log file. |
_WRITE_LOG_FILE |
|
Set to 0 to temporarily disable logging. Set to 1 to enable. |
VAREXPLICIT |
0 |
Sets variable resolution method - see Using Variables. |
IGNORESPACES |
0 |
Set script to ignore leading and trailing spaces. See Using Variables. |
IGNOREERRORS |
|
Set to 1 to ignore script error messages. Does not apply to VBScript errors (use on error next etc for VBScript errors). Set back to 0 for default behaviour. See Error Handling. |
LOCALVARS |
0 |
Set to 1 to give variable assignations local scope. See Scope. |
DISABLE_COMPLEX_EXPRESSIONS |
|
Set to 1 to disable complex expressions. Complex expressions will be seen as literal strings/regular variables. |
CF_OVERWRITE |
0 |
Set to 1 to force CopyFile, MoveFile and RenameFile to overwrite an existing target. |
Result Variables:
Some functions set special result variables rather than use parameter variables passed to the function. This is mostly for backward compatibility reasons.
WW_RESULT |
Result from WaitWindowOpen / Closed |
WCC_RESULT |
Result from WaitCursorChanged |
WSI_TIMEDOUT |
Indicates whether or not WaitScreenImage timed out |
WSI_BITMAP |
The filename of the bitmap file which was not found when WaitScreenImage timed out |
DDE_TIMEDOUT |
Timeout value from DDERequest |
RP_RESULT |
Used to store return code from RunProgram |
FTP_RESULT |
Result of FTP commands |
SMTP_RESULT |
Result of SMTPSendMail command. |
POP3_RESULT |
Stores the result of the RetrievePOP3 command |
MACRO_RESULT |
Used to set/retrieve the result of a called macro. |
CF_RESULT |
False if a CopyFile, MoveFile or RenameFile command was aborted |
CF_RESULT_CODE |
Numeric result code of a CopyFile, MoveFile or RenameFile command (0 is success). |
POP3_MSGFILES |
A semicolon delimited list of files downloaded by RetrievePOP3 |