Browse the docs

Time of day

Passes during a time-of-day window and on chosen weekdays.

It is between from and to

Details #

Compares the current local time with a window. Give range as "09:00-17:30", or from and to as "09:00" and "17:30". Times are 24-hour. The window includes the start minute and excludes the end minute, so a window with the same start and end never passes. With no window, the whole day counts.

If the end is earlier than the start, the window crosses midnight: 22:00-06:00 covers late evening and early morning. After midnight it still belongs to the weekday it started on, so days: ["fri"] with 22:00-06:00 passes until 06:00 Saturday.

days limits the condition to weekdays: mon to sun. Leave it out for every day. When range and from/to are both given, range wins.

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 now (as HH:MM), day and range.

Parameters #

ParameterTypeRequiredValuesWhat it does
dayslist ofmon tue wed thu fri sat sunAny of mon, tue, wed, thu, fri, sat, sun.
fromtext, to: Start and end as "HH:MM"; both are needed.
rangetext"HH:MM-HH:MM".
totext

Examples #

Weekday office hours
When
  1. Press ⌃⌥J
Only if
  1. If the time is between ‹start› and ‹end› on weekdays
Do
  1. Show “Working hours”
Open in Switchboard to try it
Outside office hours
When
  1. Press ⌃⌥J
Only if
  1. If the time isn't between 09:00 and 17:30
Do
  1. Show “After hours”
Open in Switchboard to try it

Gotchas #

  • A time like 9:30 (no leading zero) is rejected by the schema; write 09:30.

See also #