Variable Usage in Mini Mouse Macro
Table of Contents
Introduction
Variables in Mini Mouse Macro allow for dynamic data storage and manipulation during macro execution. They enhance the flexibility and adaptability of macros by enabling real-time decision-making and value handling.
Variable Types
Mini Mouse Macro supports several variable types, each serving unique purposes:
String Variables
- Definition: Stores textual data.
- Usage: Used for dynamic text handling in actions and conditions.
Definition Example:
1 | RUN ACTION | DEFINE STRING VARIABLE | %NAME%::John Doe
Integer Variables
- Definition: Stores whole numbers.
- Usage: Used for numerical calculations and conditions.
Definition Example:
1 | RUN ACTION | DEFINE INTEGER VARIABLE | %COUNT%::10
Decimal Variables
- Definition: Stores floating-point numbers.
- Usage: Useful for precise numerical calculations.
Definition Example:
1 | RUN ACTION | DEFINE DECIMAL VARIABLE | %BALANCE%::123.45
Boolean Variables
- Definition: Stores
TRUE
orFALSE
values. - Usage: Used for logical conditions and flow control.
Definition Example:
1 | RUN ACTION | DEFINE BOOLEAN VARIABLE | %ISACTIVE%::TRUE
Pixel Variables
- Definition: Captures bitmap data of pixel ranges.
- Usage: Used for screen-based evaluations.
Definition Example:
1 | RUN ACTION | DEFINE PIXEL RANGE VARIABLE | %PIXELS%::At Location [X=10, Y=20, W=100, H=100]
Internal Variables
Mini Mouse Macro provides predefined internal variables that can be used for dynamic content:
Date and Time Variables
%DATE%
: Current date (e.g.,4/01/2025
)%TIME%
: Current time (e.g.,5:30:06 AM
)%DATE_Y%
,%DATE_YEAR%
: Year (2025
)%DATE_M%
,%DATE_MONTH%
: Month (1
orJanuary
)%DATE_D%
,%DATE_DAY%
: Day (4
)%TIME_H%
: Hour (5
)%TIME_M%
: Minute (30
)%TIME_S%
: Second (6
)
Mouse Variables
%MOUSE_X%
: Current mouse X coordinate.%MOUSE_Y%
: Current mouse Y coordinate.
System Variables
%LASTLOG%
: Last log message.%RETURN%
: Last returned value.
FOR Loop Variables
%I%
: Current iteration count.%LINE%
: Current text line in a file loop.%FILE%
: Current file path in a file loop.%FILE.NAME%
: File name in a file loop.%FILE.PATH%
: File path in a file loop.
Environment Variables
%ENV_USERNAME%
: Username of the current user.%ENV_SYSTEMDRIVE%
: System drive (e.g.,C:
).%ENV_TEMP%
: Path to the temporary folder.%ENV_COMPUTERNAME%
: Name of the computer.
Using Variables in Conditions and Actions
Example: Using a String Variable
1 | IF | STRING VARIABLE | %NAME% | IS | "John Doe" | MESSAGE PROMPT | Welcome, %NAME%!
- This example checks if
%NAME%
equalsJohn Doe
and displays a personalized message.
Example: Using an Integer Variable
1 | IF | INTEGER VARIABLE | %COUNT% | GREATER THAN | 5 | MESSAGE PROMPT | Count is %COUNT%.
- This example evaluates if
%COUNT%
is greater than 5 and displays its value.
Best Practices
- Use descriptive names for clarity.
- Avoid overwriting system variables unless necessary.
- Test variable values in small macro segments for debugging.