Mail Rule Finder
Mail Rule Finder
- Subject: Mail Rule Finder
- From: Gil Dawson <email@hidden>
- Date: Wed, 12 Oct 2011 17:51:34 -0700
I have a bunch of rules sorting my mail into folders based usually on From email addresses. Some rules (e.g., "Friends") have dozens of conditions, so many, in fact, that I have to divide the list of conditions into numbered subrules (Friends 1, Friends 2, etc.) just so that I can see all the conditions listed in a window on my screen.
When someone changes his relationship with me (moves from Friend 6 to Board Member, for example) it's been tedious to find which condition in which rule contains his email address so that I can delete it and add it as a new condition to another rule. Until now.
I just wrote this and it seems to work nicely:
--Find which rule(s) reference(s) a particular email address
property zero : 0
set clue to "" repeat while length of clue is zero display dialog "(Just the) email address...?" default answer "" set clue to text returned of result end repeat tell application "Mail" set rcount to zero repeat with rx in rules set rcount to rcount + 1 -- log rcount set aRule to contents of rx tell aRule set ccount to zero repeat with rc in rule conditions set ccount to ccount + 1 set aCondition to contents of rc tell aCondition if clue is in (_expression_ as text) then ¬ log name of aRule & ":" & rcount & ":" & ccount & ":" & _expression_ end tell end repeat end tell end repeat end tell
I'd welcome comments.
--Gil |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden