Run Apple Script repeatedly except certain day at a specific time

I have an AppleScript (below) that I want to run at a regular interval using Automations & Named & Other Triggers with Repeating trigger.

I don't want the AppleScript to run on Saturday from 0800 to 1330.

Using Advanced Conditions I'm able to isolate Saturday, but am having difficulty isolating the time ON Saturday only. I set [current_day] [is not] [7] but the time I'm having difficulty making the time ONLY correlate to Saturday and not every day of the week. If that makes sense.

-- Run shell command to get idle time in seconds
set idleTimeCommand to "ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print $NF/1000000000; exit}'"
set idleTime to do shell script idleTimeCommand

-- Convert idle time to a number
set idleTimeSeconds to idleTime as number

-- Define your idle threshold (5 minutes = 300 seconds)
set idleThreshold to 300

-- Check if idle time exceeds threshold
if idleTimeSeconds ≥ idleThreshold then
-- Turn off display
do shell script "pmset displaysleepnow"
end if

A side note, I'm using this script because of the lack of idle trigger in BTT.

Hi @ddsforlife ,

Have you taken a look at this thread already?

1 Like

For limiting triggers to specific times, you can use advanced trigger conditions - you might need to nest them (press opt while pressing the + button)

2 Likes

Thank you! I missed the "None" at the top! Everything else I had but missed that step.