Created
February 25, 2019 15:57
-
-
Save mwhagedorn/2459e3095e8b9296a415bd06e7fedca0 to your computer and use it in GitHub Desktop.
Applescript to create a "Do Every Morning" list
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
(* | |
Creates a “Start Day” project in OmniFocus. | |
*) | |
set theMonthDay to (do shell script "date -v+0d +\"%b-%d\"") | |
set projectName to "Morning " & theMonthDay | |
set weekBefore to date (do shell script "date -v+0d +\"%B %d, %Y\"") | |
set weekBefore's hours to 6 | |
set dayBefore to date (do shell script "date -v+0d +\"%B %d, %Y\"") | |
set dayBefore's hours to 17 | |
tell front document of application "OmniFocus" | |
set homeContext to first flattened context whose name is "Mornings" | |
set theProject to make new project with properties {name:projectName, defer date:weekBefore, due date:dayBefore, context:homeContext, sequential:true} | |
tell theProject | |
-- The Sweep | |
set theSweep to make new task with properties {name:"Sweep"} | |
set s1 to make new task with properties {name:"Close Slack/IRC/Messages"} | |
set s2 to make new task with properties {name:"Enable DND"} | |
set s3 to make new task with properties {name:"Process personal email box (remember 2 minute rule)"} | |
set s4 to make new task with properties {name:"Process work email box (remember 2 minute rule)"} | |
set s5 to make new task with properties {name:"Process Slack Notifications"} | |
set s6 to make new task with properties {name:"Check Work Calendar"} | |
move s1 to the end of tasks of theSweep | |
move s2 to the end of tasks of theSweep | |
move s3 to the end of tasks of theSweep | |
move s4 to the end of tasks of theSweep | |
move s5 to the end of tasks of theSweep | |
move s6 to the end of tasks of theSweep | |
-- The Process | |
set theProcess to make new task with properties {name:"Process"} | |
set p1 to make new task with properties {name:"Process Omnifocus inbox (top to bottom)"} | |
set p2 to make new task with properties {name:"Review all projects in review tab"} | |
move p1 to the end of tasks of theProcess | |
move p2 to the end of tasks of theProcess | |
-- The Start | |
set theStart to make new task with properties {name:"Start"} | |
set s1 to make new task with properties {name:"Switch to Work Hot Perspective"} | |
set s2 to make new task with properties {name:"If no items in Work Hot, go flag some things"} | |
set s3 to make new task with properties {name:"Pick one and start working"} | |
move s1 to the end of tasks of theStart | |
move s2 to the end of tasks of theStart | |
move s3 to the end of tasks of theStart | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that "context" has been deprecated (line 17). I changed it to "primary tag" (no quotes) and my AppleScript stopped puking.