Battery
Passes when the battery level is above or below a percentage, or the Mac is charging.
The battery is below below%
Details #
Level is a percentage from 0 to 100. below passes when the level is under the value; above when it is over. charging passes when the Mac is on power (true) or on battery (false). Give several and all must hold. With none, the condition always passes.
Every condition accepts "negate": true, which flips the verdict. The trace records what was compared before the flip, so a negated condition that blocks a macro still shows the real values.
Conditions in an Only if list combine with all: every one must pass, and an empty list always passes. An if step or a repeat loop takes a match of all (default) or any.
The trace shows level (rounded to one decimal) and charging.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
above | number | Passes over this percentage. | ||
below | number | Passes under this percentage. | ||
charging | yes / no |
Examples #
- Press ⌃⌥J
- If the battery is below 20%
- Show “Battery is low”
- Press ⌃⌥J
- If the Mac is charging
- Show “On power”
Gotchas #
A Mac with no battery has no level, so
belowandabovealways fail, andchargingis always false.