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:
Any of the following are true - at least one condition must be true.
All of the following are true - every condition must be true.
None of the following are true - no condition is true.
Not all of the following are true - at least one condition must be false.
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:
test if an application is running (or not) or at the front (or not).
test if the front window exists or has a desired title (or not).
test if a button exists (or not) or is enabled (or not).
test if a menu item exists (or not) or is enabled (or not).
test if particular modifiers are pressed or not pressed.
test if a particular key is down or up.
test if a typed string trigger with remember case was a particular case.
test if a disk is mounted or not.
test if something, a file or folder exists at a particular path (or now).
test if the clipboard contains text or an image (or not) or specific text (or not).
test if a variable exists or is empty or contains specific text (or not).
test if a calculation returns non zero.
test if an envirnment variable exists or contains specific text (or not).
test if a pixel on the screen is or is brighter/darker, more or less blue, etc that a particular color.
test if the network name is or contains specific text (or not).
test if a script succeeds or returns particular status or specific text (or not).
Generally, a pixel condition should be considered a last resort, but there are certain cases where it may be useful - keep in mind that you can use expresions for calculating the location of the pixel too.