10.4: Select duplicate messages in Mail

May 11, '05 10:36:00AM

Contributed by: mal0rd

Tiger only hintThis AppleScript will select all the duplicate messages in the currently open Message Viewer window in Mail.app.

To use this script:

  1. Open up Script Editor and paste the code into a new window.
  2. Save it somewhere convenient, like the Desktop or if you have your Scripts menubar item activated, under ~/Library/Scripts.
  3. Open up Mail 2.0 and select the mailboxes to scan so the message list displays all the messages you want to scan.
  4. Run the script. When the script is finished, a notification dialog will popup.
  5. Move the selected duplicate messages to the Trash or do anything else with them.
The script works by scanning each message and recording it's message ID in a list. If the list already contains that message ID, then it selects the message.

Comments (6)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2005050314315464