First I created a Schedule Action "Alarm Clock" to do all the junk I want my system to do first thing in the morning to get me out of bed.
Variables created in indigo:
WakeUpHH (2-digit hour of 24 hour clock) 2 buttons (Increase/decrease variable by 1)
WakeUpMM (2-digit minute of 24 hour clock) 12 buttons to set value (5 minute increments) & 2 buttons to (increase/decrease variable by 1)
WakeUpTime (displays current trigger time for "alarm clock" schedule)
WakeUpTUpdate (a toggle variable to use as a control page button to trigger script below)
WakeUpSnooze (a toggle variable to use as a control page button to trigger a snooze script)
Created a Trigger "WakeUpTimeUpdate"
Trigger: variable WakeUpTUpdate changes
Condition: Always
Action: Execute Script Embedded AppleScript:
- Code: Select all
set value of variable "WakeUpTime" to (value of variable "WakeUpHH" & value of variable "WakeUpMM")
set WakeUpSeconds to ((value of variable "WakeUpHH") * 3600) + ((value of variable "WakeUpMM") * 60)
set today to current date
set time of today to 0
set newAlarmTime to today + WakeUpSeconds
set absolute trigger time of time date action "Alarm Clock" to newAlarmTime
The snooze trigger is much simpler...
Created a Trigger "WakeUpSnooze"
Trigger: variable WakeUpSnooze changes
Condition: Always
Action: Execute Script Embedded AppleScript:
- Code: Select all
set newAlarmTime to (current date) + 300 --5 minutes
set absolute trigger time of time date action "Alarm Clock" to newAlarmTime