Skip to content

Instantly share code, notes, and snippets.

@csreed
Last active May 30, 2017 13:45
Show Gist options
  • Save csreed/666ceee01617800164fddebb0bdde872 to your computer and use it in GitHub Desktop.
Save csreed/666ceee01617800164fddebb0bdde872 to your computer and use it in GitHub Desktop.
(*
Appends an entry to today’s Daily Record of Events in Evernote.
For best results, invoke the script from Keyboard Maestro or LaunchBar.
*)
property notebookName : "Planner"
property noteTags : {"daily record"}
on run -- Called when the script is run normally
set theTitle to "Daily Record of Events for " & (do shell script "date '+%A, %B %e'")
display dialog "What did you do to reach your goals?" default answer "" with title theTitle
handle_string(the result's text returned)
end run
on handle_string(str) -- Called directly when invoked from LaunchBar
tell application "Evernote"
-- add a blank line between entries
set newHTML to str & "<br />"
set theNoteBook to notebook notebookName
set noteTitle to "Daily Record " & (do shell script "date '+%Y-%m-%d'")
set todayNotes to every note of theNoteBook whose title is noteTitle
if length of todayNotes is 0 then
create note with html newHTML title noteTitle notebook theNoteBook tags noteTags
else
set theNote to first item of todayNotes
tell theNote
append html newHTML
end tell
end if
end tell
end handle_string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment