Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Delete large numbers of duplicate emails from Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Delete large numbers of duplicate emails from Mail.app
Authored by: sophistry on Jan 28, '10 07:41:49PM
had this same problem and solved it with an applescript:
tell application "Mail"
	activate
	repeat 500 times
		set theSelection to selection
		set theMessage to item 1 of theSelection
		set subj to subject of theMessage
		set recip to the recipients of theMessage
		set dats to date sent of theMessage
		set datr to date received of theMessage
		set theid to the message id of theMessage
		set siz to message size of theMessage
		
		tell application "System Events"
			key code 125 -- down arrow
		end tell
		
		set messagechanged to false
		repeat until messagechanged
			delay 0.25
			set theSelection2 to selection
			if (the (count of theSelection2) is equal to 0) then
				--display dialog "empty selection"
				set messagechanged to true
				say "skipping message"
			else
				set theMessage2 to item 1 of theSelection2
				set subj2 to subject of theMessage2
				set recip2 to the recipients of theMessage2
				set dats2 to date sent of theMessage2
				set datr2 to date received of theMessage2
				set theid2 to the message id of theMessage2
				set siz2 to message size of theMessage2
				
				if (theid2 is equal to theid and siz2 is equal to siz) then
					tell application "System Events"
						keystroke "x" using {command down}
					end tell
				else
					set messagechanged to true
					beep
				end if
			end if
			
		end repeat
		
	end repeat
end tell

tell application "Script Editor" to activate
---
soph


[ Reply to This | # ]