Re: using variables to filter mail messages
Re: using variables to filter mail messages
- Subject: Re: using variables to filter mail messages
- From: Ron Hunsinger <email@hidden>
- Date: Fri, 23 Oct 2009 16:26:38 -0700
At 9:31 AM -0400 10/22/09, Mr. Dan Pouliot wrote:
I'm trying to create a service that will look for all mail messages
with the selected text.
At 3:45 PM -0400 10/23/09, Mr. Dan Pouliot wrote:
I need this to be a service because I need to quickly locate emails
based on the sender email address.
I was hoping someone would figure out how variables can help here. I
just don't get it. Automator variables seem to be useless in all but
the most trivial circumstances. Google searches keep turning up the
same trivial examples over and over again, along with lots of
frustration that the whole thing falls apart as soon as you try to do
anything interesting.
I was able to get Automator to do what you want, by eschewing
variables altogether. My solution workflow has three steps:
1: Service receives selected text in any application. (Same as your
first step).
2: Run AppleScript, with the following script:
on run {input, parameters}
set theSender to item 1 of input
set output to {}
tell application "Mail"
repeat with acct in accounts
repeat with mbox in mailboxes of acct
set output to output & (every message of mbox
whose sender contains theSender)
end repeat
end repeat
end tell
return output
end run
3: Display Mail Messages (Same as your last step).
An obvious enhancement (left for the interested student) would be to
accept a list of accounts or mailboxes to search, instead of
searching everywhere.
-Ron Hunsinger
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden