Applescript:
(*
add a mail message to todo.txt --- place in your ~/library/scripts
*)
using terms from application "Mail"
on perform mail action with messages selectedMsgs
tell application "Mail"
repeat with msg in selectedMsgs
set theContent to content of msg
set theSender to extract name from sender of msg
set toText to "@mail @takeaction @" & theSender & "@" & theContent
tell application "Terminal"
do script "/your/path/to/todo.sh add \"" & toText & "\""
end tell
end repeat
end tell
end perform mail action with messages
end using terms from
You could make the toText line run the command and take the "add" out of the script. But I know I'm just using mine to add todos, not delete or archive.
-Dara
On Aug 2, 2006, at 10:18 PM, Dara Pressley wrote:
Ok, so I know that Gina is working on a email portion for todo.sh but here is something in the mean time for Mail.app users.
It's a first stab and very rough, but it lets me mark my emails and send them to todo.txt. I use Act-on (http://www.indev.ca/MailActOn. html ) to run the command as I read each message, but it can be assigned as a general rule for anything. You can even set a rule for anything you email to yourself and have it run the script.Applescript:(*add a mail message to todo.txt --- place in your ~/library/scripts*)using terms from application "Mail"on perform mail action with messages selectedMsgstell application "Mail"
repeat with msg in selectedMsgsset theSubject to subject of msgset theSender to extract name from sender of msgset toText to "@mail @takeaction @" & theSender & "@" & theSubjecttell application "Terminal"do script "/your/path/to/todo.sh add \"" & toText & "\""end tellend repeatend tellend perform mail action with messagesend using terms fromIf any one has any advise for improvement -- I'm welcome to it.Dara