Created
August 22, 2014 09:50
-
-
Save marcy/c9a44fd16598b1621acb to your computer and use it in GitHub Desktop.
カレントバッファの内容をEvernoteへ ref: http://qiita.com/marcy_o/items/9633d46aa5f6460cdb4b
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
(defun toevernote () | |
(interactive) | |
(shell-command (concat "/path/to/toevernote.rb " (buffer-file-name)))) |
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
#!/usr/bin/ruby | |
tmp_path = "/tmp/#{Time.new.to_i}" | |
apple_script = <<-EOF | |
on run argv | |
repeat with arg in argv | |
try | |
open for access arg | |
set note_text to read arg | |
end try | |
close access arg | |
tell application "Evernote" | |
create note title paragraph 1 of note_text with text note_text | |
end tell | |
end repeat | |
end run | |
EOF | |
system("nkf -s #{ARGV[0]} > #{tmp_path}") | |
system("osascript -e '#{apple_script}' #{tmp_path}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment