«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) |
on normalizeAddress (email) |
| email = string.popleading (email, ' ') |
| email = string.poptrailing (email, ' ') |
| local (len = sizeof (email), ix, mailpart = "", commentpart = "", ch) |
| ix = string.patternmatch ("<", email) |
| mailpart = string.mid (email, ix + 1, len - ix- 1) |
| commentpart = commentpart + ch |
| return (mailpart + " (" + commentpart + ")") |
| 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 |
with objectmodel, Eudora, eventInfo |
| local (mailboxObj = mailfolder [""].mailbox [boxName]) |
| local (msgcount = Eudora.countMessages (mailboxObj)) |
| local (firstmessage = 1, i, j, email, s) |
| firstmessage = scratchpad.lastmailmessage + 1 |
| for i = firstmessage to msgcount |
| local (x = mailboxObj.message [i]) |
| 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 |
| for j = 1 to string.countfields (email, ',') |
| s = normalizeAddress (string.nthfield (email, ',', j)) |
| if op.getlinetext () == "" |
| if not toys.opfindnext (s) |
| scratchpad.lastmailmessage = i |