View Single Post
I modified Sandro's script to take a message from Entourage and drop it into Quick Entry. In addition to copying the text of the message, I also embed a full copy of the original email so I can reply/forward/etc straight from OmniFocus. I then delete the original message from Entourage. The OCD in me requires my inbox to be empty. A few questions I'd love some help on:

1) Saving the email to a temp file, embedding that file in the task, then deleting the temp file is laborious. Is there an option to provide a url link to a message in Entourage like you can in the new Mail.app? I don't know what that url would look like.

2) This script stalls for 10-15 seconds between activating the Quick Entry box and deleting the message. Not sure why.

3) When activating Quick Entry, is there a way for the script to determine if the user "saved" or "cancelled"? If "saved", I would delete the original message; if "cancelled", I would not.

Thanks for any help.

M6

-- this is based on sandro@sandro.org's Entourage->OmniFocus script
-- use at your own peril as well ....

tell application "Microsoft Entourage"

-- get the currently selected message or messages
set selectedMessages to current messages

-- if there are no messages selected, warn the user and then quit
if selectedMessages is {} then
display dialog "Please select one or more messages first and then run this script." with icon 1
return
end if


repeat with theMessage in selectedMessages

-- parse the email(s)
set theName to subject of theMessage
set theContent to content of theMessage
set theID to ID of theMessage as string
set theFileName to "MAC OS:Users:culbrethw:Temp:" & theID & ".eml"
save theMessage in theFileName

tell application "OmniFocus"
set theDoc to default document
set theTask to theName
set theNote to theContent
tell quick entry
set NewTask to make new inbox task with properties {name:theTask, note:theContent}
tell the note of NewTask
make new file attachment with properties {file name:theFileName, embedded:true}
end tell
activate
end tell
end tell
tell application "Finder"
delete file theFileName
end tell
delete theMessage
end repeat
end tell