Created
September 5, 2014 17:25
-
-
Save bachya/b650215137dfa23a6db5 to your computer and use it in GitHub Desktop.
Send Evernote checkboxes to Toodledo
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" | |
set td_email to "[email protected]" | |
set tag_toSend to "toodledo" | |
set tag_complete to "toodledo-complete" | |
set en_notes to find notes "tag:" & tag_toSend & " todo:false" | |
repeat with en_note in en_notes | |
set the_ENML to get ENML content of en_note | |
set checkbox_string to do shell script "echo " & quoted form of the_ENML & " | grep -E '[^<]*' | sed -e 's/<[^>]*>//g'" | |
set checkboxes to paragraphs of checkbox_string | |
repeat with checkbox in checkboxes | |
tell application "Mail" | |
tell (make new outgoing message) in front window | |
set visible to false | |
make new recipient at end of to recipients with properties {address:td_email} | |
set subject to checkbox | |
set content to checkbox | |
send | |
end tell | |
end tell | |
end repeat | |
assign tag tag_complete to en_note | |
unassign tag tag_toSend from en_note | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment