-- Downloaded From: http://c-command.com/scripts/mailsmith/reply-to-eudora-message -- Last Modified: 2007-08-17 tell application "Eudora" -- message 0 is the "current message" -- the below code fails if I try to do "set m to message 0" and then access properties of m set theBody to body of message 0 set theSenderName to sender of message 0 set theFrom to field "From" of message 0 set theTo to field "To" of message 0 set theCc to field "Cc" of message 0 set theDate to message date of message 0 set theSubject to subject of message 0 end tell tell application "Mailsmith" set theFromAddress to my addressFromHeader(theFrom) set theToAddress to my addressFromHeader(theTo) set theAttribution to "On " & theDate & " " & theSenderName & " <" & theFromAddress & "> wrote:" & return & return -- workaround since "increment quote level" doesn't work properly set newBody to theAttribution repeat with p in paragraphs of theBody set newBody to newBody & "> " & p & return end repeat make new message window with properties {subject:theSubject, contents:newBody, sending account:"Lists", signature:"Michael"} make new cc_recipient at end of message window 1 with properties {address:theFromAddress} make new to_recipient at end of message window 1 with properties {address:theToAddress} --increment quote level of text of message window 1 -- stash some info in the Notes field in case addressFromHeader() messed up set theNotes to theFrom & return & theTo & return & theCc set text 2 of message window 1 to theNotes end tell on addressFromHeader(theHeader) -- This works around the fact that Eudora doesn't make the parsed headers available from the scripting interface. -- It doesn't work for all messages because the address may not be enclosed in <>, -- and there may be multiple addresses in the header. set AppleScript's text item delimiters to "<" set theAddress to characters 1 thru -2 of item 2 of (text items of theHeader) set AppleScript's text item delimiters to "" return theAddress as string end addressFromHeader