-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMorning.applescript
71 lines (60 loc) · 1.8 KB
/
Morning.applescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
set D to display dialog "Good morning, Luke. Start off clean today?" buttons {"Yep", "Nope"} default button "Yep"
# Start the morning off clean, yo!
if (button returned of D) is "Yep" then
# Exclude Finder and Terminal for ... reasons!
set excludedApps to {"Finder"}
tell application "System Events"
set appNames to get name of (processes where background only is false)
end tell
repeat with appName in appNames
if appName is not in excludedApps then
try
tell application appName to quit saving no
on error error_message number error_number
if error_number is equal to -128 then
--Keep Calm and Carry On
else
display dialog error_message
end if
delay 2
end try
end if
end repeat
end if
delay 0.5
# Launch Todoist with a countdown. Focus is important.
tell application "Todoist"
activate
delay 3
tell application "System Events" to tell process "Todoist"
keystroke "m" using {command down, shift down}
end tell
end tell
set countdown to 60
display dialog "Take a minute to focus on your top tasks for the day." giving up after countdown
# Launch Chrome ... le sigh.
do shell script "open -n -a 'Google Chrome' --args --profile-directory='Profile 1' https://calendar.google.com https://palantiri.harvestapp.com/time https://drive.google.com/drive/"
# Launch Mail
tell application "Mail"
activate
end tell
# Launch Fantastical
tell application "Fantastical 2"
activate
delay 3
tell application "System Events" to tell process "Fantastical 2"
keystroke "m" using {command down, shift down}
end tell
end tell
# Nextiva in case someone tries to ... call me?
tell application "Nextiva App"
activate
end tell
# Do I have to?
tell application "Slack"
launch
delay 8
tell application "System Events" to tell process "Slack"
keystroke "m" using {shift down}
end tell
end tell