Reply to List Digest using Eudora
Reply to List Digest using Eudora
- Subject: Reply to List Digest using Eudora
- From: Emmett Gray <email@hidden>
- Date: Sun, 4 Aug 2002 10:07:32 -0400
In light of the recent List/Eudora discussion, I thought I'd pass
this on. I have been using the following script for a couple of years
now. If you subscribe to the digest as I do then this is a wonderful
thing. Watch out for line wrap. I have indented the script with
spaces so anything without indent within the tell block or handlers
has been wrapped.
(*
Reply to digest
Michael Sch|rig 1997, Public Domain
Required Scripting Additions:
"Jon's Commands" by Jon Pugh, freely available from
<
http://www.seanet.com/~jonpugh/>
Usage: Select the digested message you want to reply to including its
headers. Hold down the command key to respond to the original sender
only.
*)
property nl : ASCII character 10
property myReturnAddr: "**PUT YOUR SUBSCRIPTION RETURN ADDRESS HERE**"
tell application "Eudora"
try
set senderOnly to ("command" is in (keys pressed)) -- OSA Menu
uses "option" for itself
set qmsg to selected text
set subj to my extractField("Subject", qmsg)
if text 1 thru 2 of subj is not "re" then set subj to "Re: " & subj
if senderOnly then
set replyTo to my extractField("From", qmsg)
set attrib to ""
else
set replyTo to field "reply-to" of message ""
set replyTo to text 11 thru -1 of replyTo -- remove leading "reply-to: "
set who to my extractField("From", qmsg)
set when to my extractField("Date", qmsg)
if "\"" is in who then
set useQuote to ""
else
set useQuote to "\""
end if
set attrib to "On " & when & ", someone using the name " &
useQuote & who & useQuote & " submitted as follows:" & return
set attrib to "On " & when & ", " & who & " wrote:" & return
end if
set msg to make new message at end of mailbox "Out"
set field "To" of msg to replyTo
set field "Subject" of msg to subj
set field "From" of msg to myReturnAddr
set msgBody to my makeBody(qmsg)
set field "" of msg to (attrib & msgBody)
on error errMsg
if length of errMsg > 255 then
set errMsg to text 1 thru 255 of errMsg
end if
display dialog errMsg buttons {"OK"} default button 1
end try
activate
end tell
on extractField(fldnm, msg)
set fldLen to (count characters of fldnm) + 1
repeat with x from 1 to (count paragraphs of msg)
set theLine to (paragraph x of msg)
set fldOff to (offset of (fldnm & ":") in theLine)
if fldOff is not 0 then
set fld to text ((offset of ":" in theLine) + 1) thru -1 of theLine
exit repeat
end if
end repeat
if fldOff is 0 then error "No " & fldnm & " found in the selected text."
repeat while first character of fld is " "
set fld to text 2 thru -1 of fld
end repeat
return fld
end extractField
on makeBody(msg)
-- remove headers (they're separated by a blank line)
set off to offset of return & return in msg
set msg to text (off + 1) thru -1 of msg
-- add quote chars
set replyMsg to ""
repeat with x from 1 to count paragraphs of msg
set replyMsg to replyMsg & ">" & paragraph x of msg & return
end repeat
return replyMsg
end makeBody
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.