Created
January 17, 2012 15:28
-
-
Save macolyte/1627063 to your computer and use it in GitHub Desktop.
Send to MarsEdit from Evernote
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
tell application "Evernote" | |
synchronize | |
set the_Selection to selection | |
set the_Title to title of (item 1 of the_Selection) | |
set the_HTML to HTML content of (item 1 of the_Selection) | |
set the_Text to do shell script "echo " & quoted form of the_HTML & space & "| textutil -convert txt -stdin -stdout" | |
set the_Tags to {} | |
set tag_list to tags of (item 1 of the_Selection) | |
repeat with a_tag in tag_list | |
set the_Tags to the_Tags & (name of a_tag) | |
end repeat | |
set old_delim to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to ", " | |
set the_Tags to the_Tags as text | |
set AppleScript's text item delimiters to old_delim | |
end tell | |
tell application "MarsEdit" | |
activate | |
make new document | |
tell document 1 | |
set title to the_Title | |
set body to the_Text | |
set tags to the_Tags | |
set text filter to "Markdown" | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment