Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Week Projects: This is a week-based version of my previous Day Projects script (
-- Week Projects
-- Created by Zettt on 2015-12-28
-- zCasting 3000.
-- This script creates "Week Projects" in OmniFocus.
-- I use these "Week Projects" to put stuff, that I need to
-- do during a specific week, but aren't big enough to be their own project.
-- Things like "Call the doctor on Wednesday" or
-- "Check out the new store on Thursday" go in these.
-- You get the idea.
-- Note: I like dates being DD.MM.YYYY.
-- Leading zeros, no month names, four digit years.
-- In case you want to modify the names,
-- `man date` is your friend.
-- Note 2:
-- In order to use "set var to date otherVar
-- you need to give it a date string in your
-- locale. In Europe it's DD. MM. YYYY., in
-- USA it's probably YYYY/MM/DD. Please
-- edit accordingly in the shell script after +
-- 1.0: Initial release
repeat with weekNumber from 1 to 52
set weekStartShell to (do shell script "date -v +" & weekNumber & "w -v +0d -v 16y +'%d. %m. %Y'")
set weekStart to date weekStartShell
set weekEndShell to do shell script "date -v +" & weekNumber & "w -v +6d -v 16y +'%d. %m. %Y'"
set weekEnd to date (weekEndShell & " 23:59:59")
set projectName to (("CW" & weekNumber & ": " & weekStartShell & " - " & weekEndShell) as string)
log projectName
log weekStart
log weekEnd
tell application "OmniFocus"
tell folder "Paused Week Projects" of folder "Day Projects" of default document
set projectWeek to make new project with properties {name:projectName, defer date:weekStart, due date:weekEnd, singleton action holder:true}
end tell
end tell
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.