Created
March 9, 2018 08:49
-
-
Save youzi/672f7690068bdf6a4475fd5620f553e1 to your computer and use it in GitHub Desktop.
Schedule tasks in "pomodoro" calendar in Calendar to get "focus" and "break" notifications.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
tell application "Calendar" | |
tell calendar "Pomodoro" | |
repeat | |
try | |
set currentEvents to first event whose start date ≤ (current date) and end date > (current date) | |
set currentSummary to currentEvents's summary | |
display notification currentSummary with title "Focus on:" sound name "Frog" | |
delay 1500 | |
display notification currentSummary with title "Take a break from:" sound name "Frog" | |
delay 300 | |
on error errMsg | |
exit repeat | |
end try | |
end repeat | |
end tell | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment