Skip to content

Instantly share code, notes, and snippets.

@zholmquist
Last active May 19, 2017 00:39
Show Gist options
  • Save zholmquist/7715258 to your computer and use it in GitHub Desktop.
Save zholmquist/7715258 to your computer and use it in GitHub Desktop.
Hazel Embedded AppleScript that logs filename to Evernote. I use this in a script that cleans up my Desktop and Downloads and files everything away.
tell application "Evernote"
tell application "Finder" to set file_name to (name of theFile)
set time_string to do shell script "date '+%H:%M:%S'"
set date_string to do shell script "date '+%Y-%m-%d'"
set message to "<p><b>" & time_string & "</b> | Moved <em>" & file_name & "</em></p>"
set matches to find notes date_string & " notebook:Log"
if (count of matches) is 1 then
set the_note to item 1 of matches
append the_note html message
else
create note with html message title date_string notebook "Log"
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment