Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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