Skip to content

Instantly share code, notes, and snippets.

@kasajei
Forked from TakashiNakagawa/gist:4700560
Last active August 26, 2017 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasajei/a6db0f9859d5d7004869a6b8be6bdfa9 to your computer and use it in GitHub Desktop.
Save kasajei/a6db0f9859d5d7004869a6b8be6bdfa9 to your computer and use it in GitHub Desktop.
alfredからevernoteへポストするノートブックはIdeasノート名は日付 同一日付なら追記される
-- ノートブックの指定
property nb : "日誌"
property _newNote : missing value
on alfred_script(q)
set _memo to q
-- Evernote
tell application "Evernote"
if not (exists of notebook nb) then
create notebook nb
end if
set dateStr to do shell script "date +'%Y/%m/%d'"
set h to hours of (current date) as string
set m to minutes of (current date) as string
set h to text -2 thru -1 of ("0" & h)
set m to text -2 thru -1 of ("0" & m)
set timeStr to h & ":" & m
set txttime to "<br/><font color=\"#C0C0C0\" size=\"1\">" & timeStr & "</font><br/>"
set foundNotes to find notes "notebook:\"" & nb & "\"" & " intitle:\"" & dateStr & "\""
set found to ((length of foundNotes) is not 0)
if not found then
set _newNote to create note with text _memo title dateStr notebook nb
tell _newNote to append html txttime
else
repeat with curnote in foundNotes
set _newNote to curnote
tell _newNote to append text _memo
tell _newNote to append html txttime
end repeat
end if
end tell
end alfred_script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment