Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tell application "Mail"
- try
- set theSelection to the selection
- if the length of theSelection is less than 1 then
- my notifyGrowl("Fail Importing Mail Message", "No messages are selected", "Not Imported")
- end if
- repeat with theMessage in theSelection
- my importMessage(theMessage)
- end repeat
- end try
- my notifyGrowl("Imported Mail Message", subject of theMessage, "Imported")
- 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 "Task created from mail message:%3c" & (message id of theMessage) & "%3e"
- set theBody to messageURL & return & return & the content of theMessage
- tell application "The Hit List"
- tell inbox to make new task with properties {timing task:theSubject, notes:theBody, start date:theDate}
- end tell
- end try
- end tell
- end importMessage
- on notifyGrowl(theTitle, theMessage, theName)
- tell application "System Events"
- set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
- end tell
- if isRunning then
- tell application id "com.Growl.GrowlHelperApp"
- -- Send a Notification...
- notify with name theName title theTitle description theMessage application name "The Hit List Mail Capture Script"
- end tell
- end if
- end notifyGrowl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement