Skip to content

Instantly share code, notes, and snippets.

@joechrysler
Last active December 27, 2015 05:24
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joechrysler/950d7360c5d523a31ea5 to your computer and use it in GitHub Desktop.
Save joechrysler/950d7360c5d523a31ea5 to your computer and use it in GitHub Desktop.
SCRIPT to move completed reminders into a DayOne journal
on run {input, parameters}
tell application "Reminders"
if (count of (reminders whose completed is true)) > 0 then
set todoList to reminders whose completed is true
repeat with itemNum from 1 to (count of (reminders whose completed is true))
set reminderObj to item itemNum of todoList
set nameObj to name of reminderObj
set compDateObj to completion date of reminderObj
if (body of reminderObj) is not "" and (body of reminderObj) is not missing value then
set bodyObj to " Notes: " & body of reminderObj
else
set bodyObj to ""
end if
set dayInt to day of compDateObj
set monthInt to month of compDateObj as integer
set yearInt to year of compDateObj
set dateStr to ((monthInt as string) & "/" & dayInt as string) & "/" & yearInt as string
set remDetails to nameObj & " " & bodyObj
set timeStr to time string of compDateObj
set shellTxt to "echo " & quoted form of remDetails & " | /usr/local/bin/dayone -d=\"" & dateStr & " " & timeStr & "\" new"
do shell script shellTxt
--delete reminderObj --uncomment this line to auto delete completed todos
end repeat
else
set output to "No completed reminders"
end if
end tell
return input
end run
@joechrysler
Copy link
Author

Credit for the original script goes to Nick Morris of Random Stuff.... I just tweaked it to handle reminders that include dollar signs and quotation marks.

@shokk
Copy link

shokk commented Dec 27, 2015

What does the automator side look like? This is just an Applescript action for Automator, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment