Skip to content

Instantly share code, notes, and snippets.

@csreed
Last active February 7, 2017 03:02
Show Gist options
  • Save csreed/0d96ba8b0be6fb12cf3c23de0c931d35 to your computer and use it in GitHub Desktop.
Save csreed/0d96ba8b0be6fb12cf3c23de0c931d35 to your computer and use it in GitHub Desktop.
(*
Creates a “Pay Rent” project in OmniFocus.
*)
set theMonth to (do shell script "date -v+1m +\"%B\"")
set projectName to "Pay " & theMonth & " Rent"
set weekBefore to date (do shell script "date -v+1m -v1d -v-1w +\"%B %d, %Y\"")
set weekBefore's hours to 6
set dayBefore to date (do shell script "date -v+1m -v1d -v-1d +\"%B %d, %Y\"")
set dayBefore's hours to 17
tell front document of application "OmniFocus"
set homeContext to first flattened context whose name is "Home"
set theProject to make new project with properties {name:projectName, start date:weekBefore, due date:dayBefore, context:homeContext, sequential:true}
tell theProject
make new task with properties {name:"Write out check"}
make new task with properties {name:"Drop off rent check"}
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment