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 ExistChecks if an object exists. Not ExistChecks if an object does not exist. IsCompares if values are equal. Is NotCompares if values are not equal. Greater ThanChecks if a value is greater than another. Greater Than Equal ToChecks if a value is greater than or equal to another. Less ThanChecks if a value is less than another. Less Than Equal ToChecks if a value is less than or equal to another. ChangesDetects 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 ContainsChecks if a variable contains a substring. Contains -CSame 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 StringChecks if a file contains a specific string. Files Contains StringChecks if any file in a folder contains a string. Files Contains String -RRecursive 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 IsChecks if a file’s MD5 hash matches. SHA1 IsChecks if a file’s SHA1 hash matches. SHA256 IsChecks if a file’s SHA256 hash matches. SHA384 IsChecks if a file’s SHA384 hash matches. SHA512 IsChecks 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 AddressChecks the source address of a packet. Destination AddressChecks the destination address of a packet. Packet Contains StringChecks if a packet contains a specific string. Packet Type TCPFilters packets by TCP type. Packet Type UDPFilters packets by UDP type. Packet Type ICMPFilters packets by ICMP type. Packet Count TCPCounts TCP packets. Packet Count UDPCounts UDP packets. Packet Count ICMPCounts ICMP packets. Packet Count TotalCounts total packets. Packet Source Port NumberChecks the source port number of a packet. Packet Destination Port NumberChecks the destination port number of a packet. Is OpenChecks if a port is open. Is ClosedChecks 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 TimeCompares a time with the current system time. Is After Current TimeCompares a time with the current system time. Is Before Current DateCompares a date with the current system date. Is After Current DateCompares a date with the current system date. Is Before Current Date & TimeCompares date and time with the current system values. Is After Current Date & TimeCompares 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 KeypressEvaluates keypresses. Mouse Position EqualsCompares the current mouse position. Mouse Position NearEvaluates if the mouse is within a specific range.
⬆️ Back to Top
OCR-Specific Operators Used to evaluate Optical Character Recognition (OCR) results.
Operator Description TrueOCR detected text successfully. FalseOCR did not detect text. SuccessfulOCR operation completed successfully. UnsuccessfulOCR operation failed. Text IsMatches text exactly. Text Is -CMatches text case-insensitively. Text ContainsChecks if detected text contains a substring. Text Contains -CCase-insensitive substring match. Text Starts WithChecks if detected text starts with a substring. Text Starts With -CCase-insensitive prefix match. Text CountCounts characters detected. Match CountCounts matches in images. ChangesEvaluates 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 TrueBoolean variable is true. Is FalseBoolean variable is false. Addition (+)Performs addition. Subtraction (-)Performs subtraction. Multiplication (*)Performs multiplication. Division (/)Performs division. Power Of (^)Calculates powers. Modulus (%)Calculates remainders. Is EvenChecks if a number is even. Is OddChecks if a number is odd.
⬆️ Back to Top
Miscellaneous Operators Special operators for advanced macro control.
Operator Description Last Condition SuccessfulChecks if the last condition evaluated successfully. Last Condition UnsuccessfulChecks 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 TRUEEvaluates if the boolean variable is true. IS FALSEEvaluates if the boolean variable is false.
CLIPBOARD Operator Description TEXT ISChecks if the clipboard contains specific text. TEXT CONTAINSChecks if the clipboard text contains a specific substring. FILE PATH ISChecks if the clipboard contains a specific file path. FILE PATH CONTAINSChecks if the clipboard file path contains a specific substring. CONTAINS A SINGLE FILEChecks if the clipboard contains a single file.
DATE Operator Description IS BEFORE CURRENT DATEChecks if the date is before the current system date. IS AFTER CURRENT DATEChecks if the date is after the current system date. ISEvaluates if the date matches a value. IS NOTEvaluates if the date does not match a value.
DECIMAL VARIABLE Operator Description ISChecks if the decimal value matches a specific value. IS NOTChecks if the decimal value does not match a specific value. GREATER THANChecks if the decimal value is greater than a specific value. GREATER THAN EQUAL TOChecks if the decimal value is greater than or equal to a specific value. LESS THANChecks if the decimal value is less than a specific value. LESS THAN EQUAL TOChecks if the decimal value is less than or equal to a specific value. IS EVENChecks if the decimal value is even. IS ODDChecks 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 FOUNDChecks if the specified image is found on the screen. IMAGE NOT FOUNDChecks if the specified image is not found on the screen.
⬆️ Back to Top
EACH Operator Description LINE INIterates over lines in a file. FILE INIterates over files in a directory. FILE IN -RRecursively iterates over files in directories.
⬆️ Back to Top
FILE Operator Description EXISTChecks if the file exists. NOT EXISTChecks if the file does not exist. FILE CONTAINS STRINGChecks if the file contains a specific string.
⬆️ Back to Top
FILE HASH Operator Description MD5 ISChecks if the file’s MD5 hash matches a value. SHA1 ISChecks if the file’s SHA1 hash matches a value. SHA256 ISChecks if the file’s SHA256 hash matches a value. SHA384 ISChecks if the file’s SHA384 hash matches a value. SHA512 ISChecks if the file’s SHA512 hash matches a value.
⬆️ Back to Top
FILE SIZE Operator Description ISEvaluates if the file size matches a value. IS NOTEvaluates if the file size does not match a value. GREATER THANChecks if the file size is greater than a value. LESS THANChecks if the file size is less than a value. GREATER THAN EQUAL TOChecks if the file size is greater than or equal to a value. LESS THAN EQUAL TOChecks if the file size is less than or equal to a value.
⬆️ Back to Top
FOLDER Operator Description EXISTChecks if the folder exists. NOT EXISTChecks if the folder does not exist. FILES CONTAINS STRINGChecks if any file in the folder contains a string. FILES CONTAINS STRING -RRecursively checks if files in the folder tree contain a string.
⬆️ Back to Top
FOLDER FILE COUNT Operator Description ISEvaluates if the file count matches a value. IS NOTEvaluates if the file count does not match a value. GREATER THANChecks if the file count is greater than a value. LESS THANChecks if the file count is less than a value. GREATER THAN EQUAL TOChecks if the file count is greater than or equal to a value. LESS THAN EQUAL TOChecks if the file count is less than or equal to a value.
⬆️ Back to Top
FOLDER SIZE Operator Description ISEvaluates if the folder size matches a value. IS NOTEvaluates if the folder size does not match a value. GREATER THANChecks if the folder size is greater than a value. LESS THANChecks if the folder size is less than a value. GREATER THAN EQUAL TOChecks if the folder size is greater than or equal to a value. LESS THAN EQUAL TOChecks 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 TRUEEvaluates if the computer is idle. IS FALSEEvaluates if the computer is not idle.
⬆️ Back to Top
INTEGER VARIABLE Operator Description ISChecks if the integer value matches a specific value. IS NOTChecks if the integer value does not match a specific value. GREATER THANChecks if the integer value is greater than a specific value. GREATER THAN EQUAL TOChecks if the integer value is greater than or equal to a specific value. LESS THANChecks if the integer value is less than a specific value. LESS THAN EQUAL TOChecks if the integer value is less than or equal to a specific value. IS EVENChecks if the integer value is even. IS ODDChecks 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 ISChecks if the specified key is pressed. IS NOTChecks if the specified key is not pressed.
⬆️ Back to Top
LAST CONDITION Operator Description SUCCESSFULEvaluates if the last condition was successful. UNSUCCESSFULEvaluates if the last condition failed.
⬆️ Back to Top
MOUSE POSITION EQUALS Operator Description ISChecks if the mouse position matches a value. IS NOTChecks if the mouse position does not match a value. GREATER THANChecks if the mouse position is greater than a value. LESS THANChecks if the mouse position is less than a value. GREATER THAN EQUAL TOChecks if the mouse position is greater than or equal to a value. LESS THAN EQUAL TOChecks if the mouse position is less than or equal to a value.
⬆️ Back to Top
MOUSE POSITION NEAR Operator Description ISChecks if the mouse position is near a value. IS NOTChecks if the mouse position is not near a value.
⬆️ Back to Top
NETWORK HOST PING REPLY Operator Description SUCCESSFULEvaluates if the ping reply was successful. UNSUCCESSFULEvaluates if the ping reply failed.
⬆️ Back to Top
NETWORK PACKET DETECTED Operator Description SOURCE ADDRESSChecks the source address of the packet. DESTINATION ADDRESSChecks the destination address of the packet. PACKET CONTAINS STRINGChecks if the packet contains a specific string. PACKET TYPE TCPChecks if the packet type is TCP. PACKET TYPE UDPChecks if the packet type is UDP. PACKET TYPE ICMPChecks if the packet type is ICMP. PACKET COUNT TCPChecks the TCP packet count. PACKET COUNT UDPChecks the UDP packet count. PACKET COUNT ICMPChecks the ICMP packet count. PACKET COUNT TOTALChecks the total packet count. PACKET SOURCE PORT NUMBERChecks the source port number of the packet. PACKET DEST PORT NUMBERChecks the destination port number of the packet.
⬆️ Back to Top
OCR Operator Description TRUEChecks if the OCR operation was successful. FALSEChecks if the OCR operation failed. SUCCESSFULChecks if the OCR detected text successfully. UNSUCCESSFULChecks if the OCR did not detect any text. TEXT ISChecks if the OCR-detected text matches a specific value. TEXT IS -CChecks if the OCR-detected text matches a specific value (case-insensitive). TEXT CONTAINSChecks if the OCR-detected text contains a specific substring. TEXT CONTAINS -CChecks if the OCR-detected text contains a substring (case-insensitive). TEXT STARTS WITH -CChecks if the OCR-detected text starts with a specific value (case-insensitive). TEXT ENDS WITHChecks if the OCR-detected text ends with a specific value. TEXT ENDS WITH -CChecks if the OCR-detected text ends with a specific value (case-insensitive). TEXT COUNTCounts the number of characters detected by OCR. MATCH COUNTCounts the number of matching patterns in the OCR-detected text. CHANGESChecks if the OCR-detected text changes.
⬆️ Back to Top
PIXEL COLOR Operator Description IS THE SAMEChecks if the pixel color matches a specific value. IS NOT THE SAMEChecks if the pixel color does not match a specific value. CHANGESChecks if the pixel color changes.
⬆️ Back to Top
PIXEL RANGE Operator Description CHANGESChecks if the pixel range changes.
⬆️ Back to Top
PIXEL VARIABLE Operator Description MATCHESChecks if the pixel variable matches a specific condition.
⬆️ Back to Top
PROCESS ID Operator Description EXISTChecks if the process ID exists. NOT EXISTChecks if the process ID does not exist.
⬆️ Back to Top
PROCESS NAME Operator Description EXISTChecks if the process exists. NOT EXISTChecks if the process does not exist.
⬆️ Back to Top
RECEIVE UDP PACKET STRING Operator Description STRING FOUNDChecks if the specified string was found.
⬆️ Back to Top
STRING VARIABLE Operator Description ISChecks if the string matches a value. IS NOTChecks if the string does not match a value. CONTAINSChecks if the string contains a specific value. CONTAINS -CChecks if the string contains a value (case-insensitive). STARTS WITHChecks if the string starts with a specific value. ENDS WITHChecks if the string ends with a specific value.
⬆️ Back to Top
TCP PORT OPEN Operator Description IS OPENChecks if the TCP port is open. IS CLOSEDChecks if the TCP port is closed.
⬆️ Back to Top
TIME Operator Description IS BEFORE CURRENT TIMEChecks if the time is before the current system time. IS AFTER CURRENT TIMEChecks if the time is after the current system time. ISEvaluates if the time matches a value. IS NOTEvaluates if the time does not match a value.
⬆️ Back to Top
TIME AND DATE Operator Description IS BEFORE CURRENT DATE & TIMEChecks if the time and date is before the current system time and date. IS AFTER CURRENT DATE & TIMEChecks if the time and date is after the current system time and date. ISEvaluates if the time and date matches a value. IS NOTEvaluates if the time and date does not match a value.
⬆️ Back to Top
WINDOW TITLE Operator Description EXISTChecks if a window with the specified title exists. NOT EXISTChecks if a window with the specified title does not exist.
⬆️ Back to Top