Last active
December 27, 2015 05:24
-
-
Save joechrysler/950d7360c5d523a31ea5 to your computer and use it in GitHub Desktop.
SCRIPT to move completed reminders into a DayOne journal
This file contains hidden or 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
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 |
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
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.