Filter threads for Mail.app (contribution)
Filter threads for Mail.app (contribution)
- Subject: Filter threads for Mail.app (contribution)
- From: Matt Petrowsky <email@hidden>
- Date: Tue, 15 Apr 2003 23:12:27 -0700
Here's a nice contribution for those of you using Mail.app. Filter
messages by thread topic - subject line.
If you use QuicKeys or iKey (formerly Youpi Key) then this script
really rocks for reading list archives in Mail.app! (doesn't work for
digest lists)
This script when put into your macro program will allow you to filter
out a specific thread (ala the Outlook grouping feature on Windows) Of
course, sorting by subject groups full threads but this is much cooler.
The script is a toggle script so I assigned mine to Cmd-Down Arrow in
QuicKeys. The cool thing is that you can go back to reading the full
list archive when sorted in chronological order.
Enjoy!
Matt Petrowsky
-- TOGGLE THREAD SCRIPT
-- 2003 by Matt Petrowsky
-- Thanks to cricket for the tips on the focused messages feature!
-- This routine strips off the "Re: " if part of the selected message
------------------------------------------------------------------------
------------------
on realThread(theString)
if characters 1 thru 4 of theString as string is equal to "Re: " then
set theSubject to characters 5 through -1 of theString as string
else
theString
end if
end realThread
-- This is the main script. This is a toggle script so you can call it
to switch between
-- focused messages and the selected mailbox
tell application "Mail"
tell message viewer 1 -- target the frontmost viewer window
if (count of focused messages) = 0 then -- focus on the selected
message
set selectedMailboxes to selected mailboxes
set selectedMailbox to item 1 of selectedMailboxes
set selectedMessages to selected messages
set selectedMessage to item 1 of selectedMessages
set theSubject to my realThread(subject of selectedMessage)
set mainMessage to every message of selectedMailbox whose subject is
theSubject
set everyMessage to every message of selectedMailbox whose subject
is ("Re: " & theSubject)
set everyMessage to everyMessage & mainMessage
set focused messages to everyMessage
else
set focused messages to {} -- clear the focused messages
end if
end tell
end tell
_______________________________________________
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.