Created
November 10, 2011 17:48
-
-
Save valpackett/1355558 to your computer and use it in GitHub Desktop.
Revisions
-
Grigory V. revised this gist
Nov 10, 2011 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,8 @@ First, ```shell $ [sudo] pip install html2text MacFSEvents ``` Then launch it and enjoy. P.S. guess what, ⌘S works in Evernote. -
Grigory V. created this gist
Nov 10, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2011 Grigory V. <[email protected]> Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ Evernote's Mac client + [Marked](http://markedapp.com/) or similar: basically just setting ~/Documents/Evernote Selection.md to the content text of current note converted from HTML to Markdown. First, ```shell $ [sudo] pip install html2text MacFSEvents ``` This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/usr/bin/env python import os import time import codecs from html2text import html2text from fsevents import Observer, Stream home = os.environ["HOME"] now = lambda: time.mktime(time.localtime()) last = now() def cb(*args): global last if now() - last > 1: codecs.open(os.path.join(home, "Documents/Evernote Selection.md"), "w", "utf-8") \ .write(html2text(os.popen("""osascript -e \ 'tell application \"Evernote\" if selection is not {} then set the_selection to selection return HTML content of item 1 of the_selection else return \"\" end if end tell'""").read().decode("utf-8"))) last = now() cb() observer = Observer() observer.schedule(Stream(cb, os.path.join(home, "Library/Application Support/Evernote/data"))) observer.start()