Browse the docs

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 #

ParameterTypeRequiredValuesWhat it does
abovenumberPasses over this percentage.
belownumberPasses under this percentage.
chargingyes / no

Examples #

Only below 20 percent
When
  1. Press ⌃⌥J
Only if
  1. If the battery is below 20%
Do
  1. Show “Battery is low”
Open in Switchboard to try it
Only when plugged in
When
  1. Press ⌃⌥J
Only if
  1. If the Mac is charging
Do
  1. Show “On power”
Open in Switchboard to try it

Gotchas #

  • A Mac with no battery has no level, so below and above always fail, and charging is always false.

See also #