Keyboard Maestro 6 IconKeyboard Maestro 6

Conduct your Mac Like a Pro!

Conditions

Keyboard Maestro includes a variety of Control Flow Actions which perform actions depending on a set of conditions.

The condition clause of the flow control actions can be any of:

This is followed by a set of specific conditions. If there are no conditions in the set at all, the action will not execute anything except the Until action which will execute the actions once. Neither side of the If Then Else will execute.

The available conditions include:

Application
test if an application is running or at the front (or not).
Front Window
test if the front window exists or has a desired title (or not).
Button
test if a button exists, is enabled or is checked (or not).
Menu
test if a menu item exists, is enabled or is marked (or not).
Modifiers
test if particular modifiers are pressed or not pressed.
Key
test if a particular key is down or up.
Typed String
test if a typed string trigger with remember case was a particular case.
Mounted Volume
test if a disk is mounted or not.
Path
test if something, a file or folder exists at a particular path (or not).
Clipboard
test if the clipboard contains text or an image or specific text (or not).
Variable
test if a variable exists or is empty or contains specific text (or not).
Text
test if a piece of arbitrary tokenised text is empty or contains specific text (or not).
Calculation
test if a calculation returns non zero.
Environment Variable
test if an environment variable exists or contains specific text (or not).
Screen Image
test if the screen contains (optionally uniquely) an image (or not).
Pixel
test if a pixel on the screen is or is brighter/darker, more or less blue, etc that a particular color.
Location
test if the network name is or contains specific text (or not).
USB Device
test if a USB device with a specified name exists (or not).
Wireless Network
test if a Wireless Network with a specified name is connected (or not).
Script
test if a script succeeds or returns particular status or specific text (or not).

Generally, a screen image and pixel conditions should be considered a last resort, but there are certain cases where it may be useful – keep in mind that you can use expressions for calculating the location of the pixel too.

When talking about matches, note that “is” refers to equality, “contains” looks for a substring, “matches” uses regular expression matching, and “conforms” refers to Universal Type Identifier matching (eg public.text).

See also the Control Flow Actions, Variables and Calculations sections.

Continue on to Recording

Close

Feedback Form

Please provide any feedback you may have


Email Address:
Subject:
Feedback:


Your email address is appreciated but is not required and will not be saved.
It will be used only for responding to or clarifying this feedback.

Documentation

Old Documentation