LoginSignup
3
4

More than 5 years have passed since last update.

カレントバッファの内容をEvernoteへ

Posted at

M-x toevernote で登録できます。

※ バッファを保存していないと動きません。

toevernote.rb
#!/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}")
(defun toevernote ()
  (interactive)
  (shell-command (concat "/path/to/toevernote.rb " (buffer-file-name))))

path には上の ruby スクリプトを指定します。

shell-command 使えば、emacs lisp 知らなくても作れるのでいいですね。

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4