«Docs: http://www.scripting.com/fatPages/97/08/buildMailList.html
«Mon, Aug 25, 1997 at 7:31:01 AM by DW
local (adroutline = @workspace.mailOutList)
if not defined (adroutline^)
toys.newObject (outlinetype, adroutline)
target.set (adroutline)
edit (adroutline)
on normalizeAddress (email)
email = string.popleading (email, ' ')
email = string.poptrailing (email, ' ')
local (len = sizeof (email), ix, mailpart = "", commentpart = "", ch)
if email beginswith "\""
ix = string.patternmatch ("<", email)
if ix > 0
mailpart = string.mid (email, ix + 1, len - ix- 1)
for i = 2 to len
ch = email [i]
if ch == "\""
break
commentpart = commentpart + ch
return (mailpart + " (" + commentpart + ")")
if email contains "<"
ix = string.patternmatch ("<", email)
mailpart = string.mid (email, ix + 1, len - ix - 1)
commentpart = string.mid (email, 1, ix - 2)
return (mailpart + " (" + commentpart + ")")
return (email) «no change, not a recognized format
local (boxname = "Out")
with objectmodel, Eudora, eventInfo
local (mailboxObj = mailfolder [""].mailbox [boxName])
local (msgcount = Eudora.countMessages (mailboxObj))
local (firstmessage = 1, i, j, email, s)
try
firstmessage = scratchpad.lastmailmessage + 1
for i = firstmessage to msgcount
local (x = mailboxObj.message [i])
try
email = Eudora.getMessageTo (x)
if string.lower (email) contains "applelink" «gotta throw it out
continue «it's a defunct service, and they used commas inside the parens
msg (email)
for j = 1 to string.countfields (email, ',')
s = normalizeAddress (string.nthfield (email, ',', j))
op.firstsummit ()
if op.getlinetext () == ""
op.setlinetext (s)
else
if not toys.opfindnext (s)
op.insert (s, up)
scratchpad.lastmailmessage = i
filemenu.save ()