This information is for TaskPaper 2 which is old and outdated. TaskPaper 3 is the current version of TaskPaper. For TaskPaper 3 support please visit the support forums.
Select a message in Mac Mail. Run this script - it will make a new entry in the Inbox of Taskpaper with the subject of the email and a URL that points to the email. To use a service instead of a script, see further down.
This really is a pretty simple process, but for the sake of the AppleScript-uninitiated (that was me until about 30 mins ago ;-), I'll detail all the steps here.
tell application "Mail"
try
set theSelection to the selection
if the length of theSelection is less than 1 then error "One or more messages must be selected."
repeat with theMessage in theSelection
my importMessage(theMessage)
end repeat
end try
end tell
on importMessage(theMessage)
tell application "Mail"
try
set theSubject to subject of theMessage
set theDate to date received of theMessage
set messageURL to "message://%3C" & (message id of theMessage) & "%3E"
tell application "TaskPaper"
tell front document
tell project named "Inbox"
make new entry with properties {name:"- " & theSubject & " " & messageURL}
end tell
end tell
end tell
end try
end tell
tell application "GrowlHelperApp"
set the allNotificationsList to ¬
{"Mail to TaskPaper success"}
set the enabledNotificationsList to ¬
{"Mail to TaskPaper success"}
register as application ¬
"Mail to TaskPaper" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "TaskPaper"
notify with name ¬
"Mail to TaskPaper success" title ¬
"Added to TaskPaper" description ¬
theSubject application name "Mail to TaskPaper"
end tell
end importMessage
Instead of using the above script directly, you can embed it in a Automator Service, which can then be called using the Service menu (and given an optional keyboard shortcut in System Preferences->Keyboard->Keyboard Shortcuts->Services, see end of list). The service will appear only in Mail.app (in the Mail->Services menu item) and remove the need (and space) for the Applescript menubar item. Caveat: I have only tested this in 10.6 ! To do so launch Automator and choose Service; with the new automator script choose "no input" and set the application to "Mail". From the sidebar pick the "execute an Applescript" task and drag it to the main automator window. In the AppleScript box, replace the text:
(* Your script goes here *)
with the script that follows. It's slightly different from the above, because Automator won't accept the subroutine. I've kept the Growl notification, and moved the message URL, sender, and date to the notes field for the task. You can edit the script to change how the task is created and displayed.
-- new script rewritten for automator
tell application "Mail"
try
set theSelection to the selection
if the length of theSelection is less than 1 then error "One or more messages must be selected."
repeat with theMessage in theSelection
set theSubject to subject of theMessage
set theDate to date received of theMessage
set theSender to sender of theMessage
set messageURL to "message://%3C" & (message id of theMessage) & "%3E"
tell application "TaskPaper"
tell front document
tell project named "Inbox"
set newEntry to make new entry with properties {entry type:task type, text content:theSubject}
tell newEntry
make new entry with properties {entry type:note type, text content:"From " & theSender & " on " & theDate}
make new entry with properties {entry type:note type, text content:messageURL}
end tell
end tell
end tell
end tell
end repeat
end try
tell application "GrowlHelperApp"
set the allNotificationsList to ¬
{"Mail to TaskPaper success"}
set the enabledNotificationsList to ¬
{"Mail to TaskPaper success"}
register as application ¬
"Mail to TaskPaper" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "TaskPaper"
notify with name ¬
"Mail to TaskPaper success" title ¬
"Added to TaskPaper" description ¬
theSubject application name "Mail to TaskPaper"
end tell
end tell