Skip to content

Instantly share code, notes, and snippets.

@marcy
Created August 22, 2014 09:50
Show Gist options
  • Save marcy/c9a44fd16598b1621acb to your computer and use it in GitHub Desktop.
Save marcy/c9a44fd16598b1621acb to your computer and use it in GitHub Desktop.
カレントバッファの内容をEvernoteへ ref: http://qiita.com/marcy_o/items/9633d46aa5f6460cdb4b
(defun toevernote ()
(interactive)
(shell-command (concat "/path/to/toevernote.rb " (buffer-file-name))))
#!/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