-
-
Save kasajei/a6db0f9859d5d7004869a6b8be6bdfa9 to your computer and use it in GitHub Desktop.
alfredからevernoteへポストするノートブックはIdeasノート名は日付 同一日付なら追記される
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
-- ノートブックの指定 | |
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