Skip to content

Instantly share code, notes, and snippets.

@joechrysler
Last active December 27, 2015 05:24
Show Gist options
  • Select an option

  • Save joechrysler/950d7360c5d523a31ea5 to your computer and use it in GitHub Desktop.

Select an option

Save joechrysler/950d7360c5d523a31ea5 to your computer and use it in GitHub Desktop.

Revisions

  1. joechrysler revised this gist Sep 28, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion move_completed_reminders_to_dayone
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ on run {input, parameters}
    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=" & quoted form of dateStr & " " & quoted form of timeStr & " new"
    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

  2. joechrysler created this gist Sep 28, 2014.
    33 changes: 33 additions & 0 deletions move_completed_reminders_to_dayone
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    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=" & quoted form of dateStr & " " & quoted form of 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