Skip to content

Instantly share code, notes, and snippets.

@evantravers
Last active October 13, 2023 12:28
Show Gist options
  • Save evantravers/873236373223439db439c993b3fdae02 to your computer and use it in GitHub Desktop.
Save evantravers/873236373223439db439c993b3fdae02 to your computer and use it in GitHub Desktop.
Pulling my weekly reviews out of completed Projects in Things.app for use in Obisidian notes
(function() {
let Things = Application("Things");
app = Application.currentApplication()
app.includeStandardAdditions = true
Things.launch();
for (proj of Things.projects().filter(p => p.tagNames().match(/Rituals/) && p.name().match(/Weekly/) && p.status() == 'completed')) {
let d = proj.completionDate()
let formatted_date = `${d.getFullYear()}-${((d.getMonth()+1).toString()).padStart(2, '0')}-${d.getDate().toString().padStart(2, '0')}`;
let content = `## ${proj.name()}\n\n${proj.notes()}`
app.doShellScript(`echo "${content}" > ~/Desktop/journal/${formatted_date}.md`)
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment