Prism.js Language Definition: mmm Mini Mouse Macro Conditional Expressions (Operators) Guide This guide provides a comprehensive overview of the conditional expressions, referred to as Operators within Mini Mouse Macro, that enable you to create powerful and dynamic macros.
Conditional expressions are essential for building macros that adapt to different situations, make decisions based on various factors, and handle potential errors gracefully. By using these conditions, you can control the flow of your macros, determining which actions are executed based on the current state of your system, applications, or variables.
Table of Contents How Conditionals Work General Operators String-Specific Operators File and Folder-Specific Operators Hash-Specific Operators Network-Specific Operators Time and Date-Specific Operators Keyboard and Mouse-Specific Operators OCR-Specific Operators Boolean, Integer, and Decimal-Specific Operators Miscellaneous Operators Notes Comprehensive List of Operator Conditions Operators by Object CLIPBOARD DATE DECIMAL VARIABLE DETECT IMAGE EACH FILE FILE HASH FILE SIZE FOLDER FOLDER FILE COUNT FOLDER SIZE I IDLE INTEGER VARIABLE KEYBOARD KEYPRESS LAST CONDITION MOUSE POSITION EQUALS MOUSE POSITION NEAR NETWORK HOST PING REPLY NETWORK PACKET DETECTED OCR PIXEL COLOR PIXEL RANGE PIXEL VARIABLE PROCESS ID PROCESS NAME RECEIVE UDP PACKET STRING STRING VARIABLE TCP PORT OPEN TIME TIME AND DATE WINDOW TITLE How Conditionals Work At their core, conditional expressions evaluate to either true or false. This outcome determines whether a specific block of actions within your macro is executed or skipped. For example, you might create a macro that performs an action only if a specific window is open or a particular key is pressed.
In Mini Mouse Macro, conditional expressions are typically used in conjunction with the IF
command, which allows you to define a condition that must be met for a set of actions to be executed. The IF
command is followed by an operator that evaluates the condition, such as checking if a file exists, a key is pressed, or a specific text is detected on the screen.
Examples of conditional expressions include:
* | 'CONTAINS' - checks if a variable contains a specific substring.
1 | IF | STRING VARIABLE | %STRING_VAR% | CONTAINS | Hello | THEN |
2 | RUN ACTION | MESSAGE PROMPT | Found Hello!
3 | IF | END IF
* | 'IS AFTER CURRENT TIME' - compares a time with the current system time.
1 | IF | FILE | C:\example.txt | EXIST | DELETE FILE | C:\example.txt
* | 'IS' - compares if values are equal.
1 | IF | INTEGER VARIABLE | %INTEGER_VAR% | IS | 10 | THEN
2 | RUN ACTION | MESSAGE PROMPT | Value is 10
3 | IF | END IF
In each of these examples, the IF
command is followed by an operator that evaluates a specific condition. If the condition is met, the subsequent actions are executed. If the condition is not met, the actions are skipped. This allows you to create macros that respond intelligently to different scenarios.
General Operators General operators are used to evaluate basic conditions and comparisons.
Operator Description Exist
Checks if an object exists. Not Exist
Checks if an object does not exist. Is
Compares if values are equal. Is Not
Compares if values are not equal. Greater Than
Checks if a value is greater than another. Greater Than Equal To
Checks if a value is greater than or equal to another. Less Than
Checks if a value is less than another. Less Than Equal To
Checks if a value is less than or equal to another. Changes
Detects changes in pixel color or pixel range.
Examples 1 | IF | FILE | C:\tasklog.log | EXIST | DELETE FILE | C:\tasklog.log
2 | IF | FOLDER | C:\MMM | NOT EXIST | GOTO MACRO LINE | 5
3 | IF | DATE | 12/31/2024 | IS | STOP
4 | IF | TIME AND DATE | 14:25:30 25Jun2021 | IS | CONTINUE
5 | IF | FILE SIZE | C:\example.txt | GREATER THAN | 1024 | CONTINUE
6 | IF | FOLDER FILE COUNT | C:\example_folder | GREATER THAN EQUAL TO | 5 | PAUSE
7 | IF | PIXEL COLOR | At Location [X:784 Y:602] | CHANGES::2::30::200 | MESSAGE PROMPT | Pixel changed 2 times in 30 seconds::Pixel Change::0
8 | IF | PIXEL RANGE | At Location [X:2768 Y:602]::Size [W:68 H:62] | CHANGES::1::0::0 | GOTO MACRO LINE | 10
⬆️ Back to Top
String-Specific Operators These operators are used for evaluating string variables.
Operator Description Contains
Checks if a variable contains a substring. Contains -C
Same as Contains
, but case-insensitive.
Examples 1 | IF | STRING VARIABLE | %STRING_VAR% | CONTAINS | Hello | MESSAGE PROMPT | Found Hello!
2 | IF | STRING VARIABLE | %STRING_VAR% | CONTAINS -C | hello | CONTINUE
3 | IF | STRING VARIABLE | %LINE% | CONTAINS -C | _%integer%_%string1%_ | NEXT FOR | ELSE | 5 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER1%::+1
⬆️ Back to Top
File and Folder-Specific Operators Evaluate conditions based on file or folder properties.
Operator Description File Contains String
Checks if a file contains a specific string. Files Contains String
Checks if any file in a folder contains a string. Files Contains String -R
Recursive check for files in a folder tree containing a string.
Examples 1 | IF | FILE | C:\rescue.log | FILE CONTAINS STRING | error | KILL PROCESS ID | 8732
2 | IF | FOLDER | C:\logs | FILES CONTAINS STRING | Warning | MESSAGE PROMPT | Warning Found!
3 | IF | FOLDER | C:\logs | FILES CONTAINS STRING -R | Critical | EXIT
⬆️ Back to Top
Hash-Specific Operators Used to verify file integrity using cryptographic hash algorithms.
Operator Description MD5 Is
Checks if a file’s MD5 hash matches. SHA1 Is
Checks if a file’s SHA1 hash matches. SHA256 Is
Checks if a file’s SHA256 hash matches. SHA384 Is
Checks if a file’s SHA384 hash matches. SHA512 Is
Checks if a file’s SHA512 hash matches.
Examples 1 | IF | FILE HASH | C:\example.txt | MD5 IS | bfe75d55a12df081a06e463eefc7f0c5 | WAIT SECONDS | 30
2 | IF | FILE HASH | C:\example.txt | SHA256 IS | 2cf24dba5fb0a30e26e83b2ac5bc0ac7b1b356af8e1ad1a2e4f9cc5c0d8d445f | STOP
⬆️ Back to Top
Network-Specific Operators Evaluate conditions related to network packets and addresses.
Operator Description Source Address
Checks the source address of a packet. Destination Address
Checks the destination address of a packet. Packet Contains String
Checks if a packet contains a specific string. Packet Type TCP
Filters packets by TCP type. Packet Type UDP
Filters packets by UDP type. Packet Type ICMP
Filters packets by ICMP type. Packet Count TCP
Counts TCP packets. Packet Count UDP
Counts UDP packets. Packet Count ICMP
Counts ICMP packets. Packet Count Total
Counts total packets. Packet Source Port Number
Checks the source port number of a packet. Packet Destination Port Number
Checks the destination port number of a packet. Is Open
Checks if a port is open. Is Closed
Checks if a port is closed.
Examples 1 | IF | NETWORK PACKET DETECTED | Wi-Fi | SOURCE ADDRESS | 192.168.0.2::10000 | LOAD MACRO | C:\MMM\NetworkFind.mmmacro
2 | IF | NETWORK PACKET DETECTED | Ethernet | PACKET CONTAINS STRING | LoadMacro::30000 | THEN
3 | RUN ACTION | LOAD MACRO | B:\MMM\Connect.mmmacro
4 | IF | ELSE
5 | IF | RUN ACTION | LOAD MACRO | B:\MMM\startprocess.mmmacro
6 | IF | END IF
7 | IF | NETWORK PACKET DETECTED | Ethernet | PACKET TYPE TCP | 0 | SEND UDP PACKET STRING | 10.0.0.100::41414::DISCOVER_PEER
8 | IF | TCP PORT OPEN | 127.0.0.1::80::100 | IS CLOSED | MESSAGE PROMPT | The local web server on port 80 is CLOSED::Port Closed
9 | IF | TCP PORT OPEN | 192.168.0.2::41414::200 | IS OPEN | SEND UDP PACKET STRING | 192.168.0.2::41414::LoadMacro5
⬆️ Back to Top
Time and Date-Specific Operators Evaluate conditions based on time and date values.
Operator Description Is Before Current Time
Compares a time with the current system time. Is After Current Time
Compares a time with the current system time. Is Before Current Date
Compares a date with the current system date. Is After Current Date
Compares a date with the current system date. Is Before Current Date & Time
Compares date and time with the current system values. Is After Current Date & Time
Compares date and time with the current system values.
⬆️ Back to Top
Keyboard and Mouse-Specific Operators Operators for evaluating keyboard and mouse events.
Operator Description Keyboard Keypress
Evaluates keypresses. Mouse Position Equals
Compares the current mouse position. Mouse Position Near
Evaluates if the mouse is within a specific range.
⬆️ Back to Top
OCR-Specific Operators Used to evaluate Optical Character Recognition (OCR) results.
Operator Description True
OCR detected text successfully. False
OCR did not detect text. Successful
OCR operation completed successfully. Unsuccessful
OCR operation failed. Text Is
Matches text exactly. Text Is -C
Matches text case-insensitively. Text Contains
Checks if detected text contains a substring. Text Contains -C
Case-insensitive substring match. Text Starts With
Checks if detected text starts with a substring. Text Starts With -C
Case-insensitive prefix match. Text Count
Counts characters detected. Match Count
Counts matches in images. Changes
Evaluates if text changes within a screen area.
⬆️ Back to Top
Boolean, Integer, and Decimal-Specific Operators These operators evaluate numerical and boolean conditions.
Operator Description Is True
Boolean variable is true. Is False
Boolean variable is false. Addition (+)
Performs addition. Subtraction (-)
Performs subtraction. Multiplication (*)
Performs multiplication. Division (/)
Performs division. Power Of (^)
Calculates powers. Modulus (%)
Calculates remainders. Is Even
Checks if a number is even. Is Odd
Checks if a number is odd.
⬆️ Back to Top
Miscellaneous Operators Special operators for advanced macro control.
Operator Description Last Condition Successful
Checks if the last condition evaluated successfully. Last Condition Unsuccessful
Checks if the last condition failed.
⬆️ Back to Top
Notes Some operators are specific to particular objects (e.g., files, folders, or variables). Combining operators and conditions allows for highly dynamic and powerful macros. For further details, visit the official Mini Mouse Macro documentation .
Comprehensive List of Operator Conditions Below is a detailed extraction of all operator conditions available in Mini Mouse Macro. This guide is designed to help you understand and utilize various operators for evaluating objects and controlling macro flow effectively.
Object-Specific Operators Operators by Object BOOLEAN VARIABLE
Operator Description IS TRUE
Evaluates if the boolean variable is true. IS FALSE
Evaluates if the boolean variable is false.
CLIPBOARD Operator Description TEXT IS
Checks if the clipboard contains specific text. TEXT CONTAINS
Checks if the clipboard text contains a specific substring. FILE PATH IS
Checks if the clipboard contains a specific file path. FILE PATH CONTAINS
Checks if the clipboard file path contains a specific substring. CONTAINS A SINGLE FILE
Checks if the clipboard contains a single file.
DATE Operator Description IS BEFORE CURRENT DATE
Checks if the date is before the current system date. IS AFTER CURRENT DATE
Checks if the date is after the current system date. IS
Evaluates if the date matches a value. IS NOT
Evaluates if the date does not match a value.
DECIMAL VARIABLE Operator Description IS
Checks if the decimal value matches a specific value. IS NOT
Checks if the decimal value does not match a specific value. GREATER THAN
Checks if the decimal value is greater than a specific value. GREATER THAN EQUAL TO
Checks if the decimal value is greater than or equal to a specific value. LESS THAN
Checks if the decimal value is less than a specific value. LESS THAN EQUAL TO
Checks if the decimal value is less than or equal to a specific value. IS EVEN
Checks if the decimal value is even. IS ODD
Checks if the decimal value is odd. =
Checks for equality. !=
Checks for inequality. >
Checks if the decimal value is greater than another value. >=
Checks if the decimal value is greater than or equal to another value. <
Checks if the decimal value is less than another value. <=
Checks if the decimal value is less than or equal to another value. *
Performs multiplication. /
Performs division. -
Performs subtraction. +
Performs addition. ^
Performs exponentiation. %
Calculates the remainder of division.
⬆️ Back to Top
DETECT IMAGE Operator Description IMAGE FOUND
Checks if the specified image is found on the screen. IMAGE NOT FOUND
Checks if the specified image is not found on the screen.
⬆️ Back to Top
EACH Operator Description LINE IN
Iterates over lines in a file. FILE IN
Iterates over files in a directory. FILE IN -R
Recursively iterates over files in directories.
⬆️ Back to Top
FILE Operator Description EXIST
Checks if the file exists. NOT EXIST
Checks if the file does not exist. FILE CONTAINS STRING
Checks if the file contains a specific string.
⬆️ Back to Top
FILE HASH Operator Description MD5 IS
Checks if the file’s MD5 hash matches a value. SHA1 IS
Checks if the file’s SHA1 hash matches a value. SHA256 IS
Checks if the file’s SHA256 hash matches a value. SHA384 IS
Checks if the file’s SHA384 hash matches a value. SHA512 IS
Checks if the file’s SHA512 hash matches a value.
⬆️ Back to Top
FILE SIZE Operator Description IS
Evaluates if the file size matches a value. IS NOT
Evaluates if the file size does not match a value. GREATER THAN
Checks if the file size is greater than a value. LESS THAN
Checks if the file size is less than a value. GREATER THAN EQUAL TO
Checks if the file size is greater than or equal to a value. LESS THAN EQUAL TO
Checks if the file size is less than or equal to a value.
⬆️ Back to Top
FOLDER Operator Description EXIST
Checks if the folder exists. NOT EXIST
Checks if the folder does not exist. FILES CONTAINS STRING
Checks if any file in the folder contains a string. FILES CONTAINS STRING -R
Recursively checks if files in the folder tree contain a string.
⬆️ Back to Top
FOLDER FILE COUNT Operator Description IS
Evaluates if the file count matches a value. IS NOT
Evaluates if the file count does not match a value. GREATER THAN
Checks if the file count is greater than a value. LESS THAN
Checks if the file count is less than a value. GREATER THAN EQUAL TO
Checks if the file count is greater than or equal to a value. LESS THAN EQUAL TO
Checks if the file count is less than or equal to a value.
⬆️ Back to Top
FOLDER SIZE Operator Description IS
Evaluates if the folder size matches a value. IS NOT
Evaluates if the folder size does not match a value. GREATER THAN
Checks if the folder size is greater than a value. LESS THAN
Checks if the folder size is less than a value. GREATER THAN EQUAL TO
Checks if the folder size is greater than or equal to a value. LESS THAN EQUAL TO
Checks if the folder size is less than or equal to a value.
⬆️ Back to Top
I Operator Description =
Evaluates equality.
⬆️ Back to Top
IDLE Operator Description IS TRUE
Evaluates if the computer is idle. IS FALSE
Evaluates if the computer is not idle.
⬆️ Back to Top
INTEGER VARIABLE Operator Description IS
Checks if the integer value matches a specific value. IS NOT
Checks if the integer value does not match a specific value. GREATER THAN
Checks if the integer value is greater than a specific value. GREATER THAN EQUAL TO
Checks if the integer value is greater than or equal to a specific value. LESS THAN
Checks if the integer value is less than a specific value. LESS THAN EQUAL TO
Checks if the integer value is less than or equal to a specific value. IS EVEN
Checks if the integer value is even. IS ODD
Checks if the integer value is odd. =
Checks for equality. !=
Checks for inequality. >
Checks if the integer value is greater than another value. >=
Checks if the integer value is greater than or equal to another value. <
Checks if the integer value is less than another value. <=
Checks if the integer value is less than or equal to another value. *
Performs multiplication. /
Performs division. -
Performs subtraction. +
Performs addition. ^
Performs exponentiation. %
Calculates the remainder of division.
⬆️ Back to Top
KEYBOARD KEYPRESS Operator Description IS
Checks if the specified key is pressed. IS NOT
Checks if the specified key is not pressed.
⬆️ Back to Top
LAST CONDITION Operator Description SUCCESSFUL
Evaluates if the last condition was successful. UNSUCCESSFUL
Evaluates if the last condition failed.
⬆️ Back to Top
MOUSE POSITION EQUALS Operator Description IS
Checks if the mouse position matches a value. IS NOT
Checks if the mouse position does not match a value. GREATER THAN
Checks if the mouse position is greater than a value. LESS THAN
Checks if the mouse position is less than a value. GREATER THAN EQUAL TO
Checks if the mouse position is greater than or equal to a value. LESS THAN EQUAL TO
Checks if the mouse position is less than or equal to a value.
⬆️ Back to Top
MOUSE POSITION NEAR Operator Description IS
Checks if the mouse position is near a value. IS NOT
Checks if the mouse position is not near a value.
⬆️ Back to Top
NETWORK HOST PING REPLY Operator Description SUCCESSFUL
Evaluates if the ping reply was successful. UNSUCCESSFUL
Evaluates if the ping reply failed.
⬆️ Back to Top
NETWORK PACKET DETECTED Operator Description SOURCE ADDRESS
Checks the source address of the packet. DESTINATION ADDRESS
Checks the destination address of the packet. PACKET CONTAINS STRING
Checks if the packet contains a specific string. PACKET TYPE TCP
Checks if the packet type is TCP. PACKET TYPE UDP
Checks if the packet type is UDP. PACKET TYPE ICMP
Checks if the packet type is ICMP. PACKET COUNT TCP
Checks the TCP packet count. PACKET COUNT UDP
Checks the UDP packet count. PACKET COUNT ICMP
Checks the ICMP packet count. PACKET COUNT TOTAL
Checks the total packet count. PACKET SOURCE PORT NUMBER
Checks the source port number of the packet. PACKET DEST PORT NUMBER
Checks the destination port number of the packet.
⬆️ Back to Top
OCR Operator Description TRUE
Checks if the OCR operation was successful. FALSE
Checks if the OCR operation failed. SUCCESSFUL
Checks if the OCR detected text successfully. UNSUCCESSFUL
Checks if the OCR did not detect any text. TEXT IS
Checks if the OCR-detected text matches a specific value. TEXT IS -C
Checks if the OCR-detected text matches a specific value (case-insensitive). TEXT CONTAINS
Checks if the OCR-detected text contains a specific substring. TEXT CONTAINS -C
Checks if the OCR-detected text contains a substring (case-insensitive). TEXT STARTS WITH -C
Checks if the OCR-detected text starts with a specific value (case-insensitive). TEXT ENDS WITH
Checks if the OCR-detected text ends with a specific value. TEXT ENDS WITH -C
Checks if the OCR-detected text ends with a specific value (case-insensitive). TEXT COUNT
Counts the number of characters detected by OCR. MATCH COUNT
Counts the number of matching patterns in the OCR-detected text. CHANGES
Checks if the OCR-detected text changes.
⬆️ Back to Top
PIXEL COLOR Operator Description IS THE SAME
Checks if the pixel color matches a specific value. IS NOT THE SAME
Checks if the pixel color does not match a specific value. CHANGES
Checks if the pixel color changes.
⬆️ Back to Top
PIXEL RANGE Operator Description CHANGES
Checks if the pixel range changes.
⬆️ Back to Top
PIXEL VARIABLE Operator Description MATCHES
Checks if the pixel variable matches a specific condition.
⬆️ Back to Top
PROCESS ID Operator Description EXIST
Checks if the process ID exists. NOT EXIST
Checks if the process ID does not exist.
⬆️ Back to Top
PROCESS NAME Operator Description EXIST
Checks if the process exists. NOT EXIST
Checks if the process does not exist.
⬆️ Back to Top
RECEIVE UDP PACKET STRING Operator Description STRING FOUND
Checks if the specified string was found.
⬆️ Back to Top
STRING VARIABLE Operator Description IS
Checks if the string matches a value. IS NOT
Checks if the string does not match a value. CONTAINS
Checks if the string contains a specific value. CONTAINS -C
Checks if the string contains a value (case-insensitive). STARTS WITH
Checks if the string starts with a specific value. ENDS WITH
Checks if the string ends with a specific value.
⬆️ Back to Top
TCP PORT OPEN Operator Description IS OPEN
Checks if the TCP port is open. IS CLOSED
Checks if the TCP port is closed.
⬆️ Back to Top
TIME Operator Description IS BEFORE CURRENT TIME
Checks if the time is before the current system time. IS AFTER CURRENT TIME
Checks if the time is after the current system time. IS
Evaluates if the time matches a value. IS NOT
Evaluates if the time does not match a value.
⬆️ Back to Top
TIME AND DATE Operator Description IS BEFORE CURRENT DATE & TIME
Checks if the time and date is before the current system time and date. IS AFTER CURRENT DATE & TIME
Checks if the time and date is after the current system time and date. IS
Evaluates if the time and date matches a value. IS NOT
Evaluates if the time and date does not match a value.
⬆️ Back to Top
WINDOW TITLE Operator Description EXIST
Checks if a window with the specified title exists. NOT EXIST
Checks if a window with the specified title does not exist.
⬆️ Back to Top