How it works
- It can read the same values your step settings can: earlier step results, variables, routine inputs, the trigger, the current loop round, remembered values and information about the PC.
- It never reads your saved secrets; an expression that tries is refused when it's checked.
- Empty text, 0, an empty list, an empty dictionary and nothing at all count as false; everything else counts as true.
- A typo or a value of the wrong type fails the step with a plain message, rather than quietly guessing.
- Inside a Repeat or a Wait until it's only read once, so checking it over and over stays cheap.
Routines that use it
Only after the third try
Count attempts with Set variable inside a Repeat and leave with Stop repeating once an expression says the count is 3 or more and the app is ready.
One check for two conditions
Before Press keys, test that the right app is in front and a remembered value is on in a single expression instead of two nested Ifs.
Wait for a calculated value
Use the expression in a Wait until to hold the routine until a value from Calculate passes a threshold.
Settings
| Setting | What it does |
|---|---|
| Expr | An expression that is true or false, such as vars.count >= 3 and env.frontmostApp.exe == "Code.exe". |
Good to know
- You need to type the expression yourself; there's no form for it.
- Saved secrets can't be used inside an expression.
Questions
- What counts as false in an Expression is true check?
- Empty text, the number 0, an empty list, an empty dictionary and no value at all are false. Anything else is true.
- Do I need to know programming to use KeyRoutines conditions?
- No. Most checks are covered by Compare values and the other form-based conditions. Expression is true is there for people who prefer typing one line.