Re: Entourage X Duplicate Email Remover?
Re: Entourage X Duplicate Email Remover?
- Subject: Re: Entourage X Duplicate Email Remover?
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 29 May 2002 08:15:15 -0700
On 5/29/02 5:20 AM, "Jason Bourque" <email@hidden> wrote:
>
Hello,
>
>
It happened yet again. My mac.com email account is resending me my emails.
>
So I now have duplicates of everything. Could be a problem with Entourage
>
for all I know.
It is _not_ a problem with Entourage. It's the mac.com server.
>
>
Has anyone written a script that will cleanup this mess? And would like to
>
share it of course!
>
Take a look at the headers (View /Source). Are they true duplicates - do
they have the same Message-ID number? That would be the most efficient way
to search, parsing the headers, except you run into an obscure but fatal bug
with search string length (ask me another time). You should instead look
for messages whose sender, subject and time sent are identical, which i
suppose is just as good. When writing scripts that do deletions, always work
"backwards" from the end so you don't skip any and hit errors half way
through:
----------------
tell application "Microsoft Entourage"
set theFolder to displayed feature of main window
if class of theFolder folder then
beep
display dialog "First select a folder in the main window." buttons
{"Cancel"} default button 1 with icon 0
--return
end if
--set theMessages to current messages -- if selecting messages
set theMessages to every message in theFolder -- or comment out
repeat with i from (count theMessages) to 1 by -1
set theMsg to item i of theMessages
set {theSender, theSubject, theTImeSent} to theMsg's {sender,
subject, time sent}
set dupMsgs to (every message of theFolder whose sender is theSender
and subject is theSubject and time sent is theTImeSent)
if (count dupMsgs) > 1 then delete theMsg
-- add code I sent you last time for deleting from server if needed
end repeat
end tell
-----------------------
Be prepared to wait a long time. Multiple filtering on tree properties with
'whose' can take a long time and is memory-intensive. I'd suggest that you
first isolate a subset of messages containing the duplicates into their own
subfolder so the script can look through as small a group of messages as
possible. You don't want it searching through 5000 messages for matches if
you can confine it to it to 300. [Even if you take the 'selection' option,
it doesn't help all that much since the 'whose' clauses for searching till
have to be on 'theFolder' : you can't use 'whose' clauses with AppleScript
lists like 'theMessages', only with application objects like a folder.) I
sent you code last time for purging messages from local folder and server
which you can insert (only connect once, at the end of the repeat loop). The
above code just puts duplicates into the Deleted Items folder, which you can
look over and then empty when done.
--
Paul Berkowitz
_______________________________________________
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.