Created
March 25, 2014 14:30
-
-
Save tdzuba/9763029 to your computer and use it in GitHub Desktop.
Evernote Diary script
This file contains 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
-- Written by Tyler Dzuba, 2014-03-25 | |
-- Modified from http://veritrope.com/code/evernote-daily-diary/ | |
-- Referenced in http://letterstoayounglibrarian.blogspot.com/2014/03/what-did-i-do-keeping-track-of.html | |
-- Enjoy! | |
set nowDate to current date | |
set shortDate to short date string of (nowDate) | |
set nowTime to time string of (nowDate) | |
set newEntry to text returned of (display dialog "What did you do?" default answer "") | |
if newEntry is not "" then | |
tell application "Evernote" | |
set existingNotes to find notes "notebook:\"UR Journal\" intitle:\"" & shortDate & "\"" | |
if ((length of existingNotes) = 0) then | |
display dialog "Making new note" | |
set theNote to create note title shortDate with text "" notebook "UR Journal" | |
else if ((length of existingNotes) > 1) then | |
-- there should never be a case in which this happens. But just in case. | |
display dialog "More than one! Using the first" | |
set theNote to item 1 of existingNotes | |
else | |
-- display dialog "Already have note" | |
set theNote to item 1 of existingNotes | |
end if | |
set entryText to nowTime & ": " & newEntry | |
tell theNote to append html entryText & "<br>" | |
end tell | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment