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 #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
days | list of | mon tue wed thu fri sat sun | Any of mon, tue, wed, thu, fri, sat, sun. | |
from | text | , to: Start and end as "HH:MM"; both are needed. | ||
range | text | "HH:MM-HH:MM". | ||
to | text |
Examples #
- Press ⌃⌥J
- If the time is between ‹start› and ‹end› on weekdays
- Show “Working hours”
- Press ⌃⌥J
- If the time isn't between 09:00 and 17:30
- Show “After hours”
Gotchas #
A time like
9:30(no leading zero) is rejected by the schema; write09:30.