Using Evernote + AppleScript + QuickSilver for a daily task log

Trying to be better about tracking my daily workload, I need a lightweight hotkey-based mechanism to quickly capture something as I switch tasks. I can then go back later and total up the times, or just jog my memory about what I was doing on a certain day at a certain time. Tracking this information in Evernote is also a bonus as it’s available and searchable on all my devices.

I created an AppleScript first that did the actions needed:

(* Notebook name to create these journal entries in *)
property nb : "Daily Diary"


NOTE: I have added a new portion to the script so that users who
aren't familiar with how to use a handler can run the Script
directly and check it out. If you'd like to use this as a handler
in your own AppleScript, Just delete or comment out the portion


set notetext to text returned of (display dialog "Diary Entry" default answer "")
my handle_string(notetext)

on handle_string(notetext)
if notetext is not "" then
end if
end handle_string


on CreateDailyEvernote(txt)
set t to "Daily Journal " & (do shell script "date +'%Y-%m-%d'")
set crlf to (ASCII character 13) & (ASCII character 10)
set timeStr to time string of (current date)

(* keep track of the app that was running when we hit the hotkey *)
set frontApp to (path to frontmost application as Unicode text)

tell application "Evernote"
set foundNotes to find notes "notebook:\"" & nb & "\"" & " intitle:\"" & t & "\""
set found to ((length of foundNotes) is not 0)
if not found then
set curnote to create note with text crlf & timeStr & ": " & txt & crlf title t notebook nb
repeat with curnote in foundNotes
tell curnote to append text crlf & timeStr & ": " & txt & crlf
end repeat
end if
end tell

(* put the old foreground app back on top *)
tell application frontApp to activate

(* just to be sure there are no odd effects, explicitly hide Evernote *)
tell application "System Events"
set visible of process "Evernote" to false
end tell

end CreateDailyEvernote

and then set a QuickSilver trigger to run the script (I use Ctrl-Cmd-J — for “Journal”).

The effect is a simple plain-text list of entries.

This process is based mainly on the work done by Sonny Gill (“Creating a daily log in Evernote from Quicksilver“), but I took out the parts that write HTML into the note and deal with the clipboard as I don’t want either. I also added some AppleScript to put back the foreground app that was running when I hit the hotkey, in order to minimize the impact to my workflow. I don’t want to have to be clicking or using Cmd-Tab to try and get back to the app I was running before…