Re: Notification when new email received
Re: Notification when new email received
- Subject: Re: Notification when new email received
- From: Steve Cronin <email@hidden>
- Date: Mon, 19 Nov 2007 09:04:51 -0600
Has;
I had not realized that Mail rules could be created by scripts!
This overcomes my hesitation with what I had thought to be the best
solution: have Mail tell me when mail arrives!
I did not want to make a customer have to create a mail rule - many
folks would rather stab themselves with a rusty fork.
Based on your response I've already got a rule created by script that
will ping me with only the exact messages I'm interested in! YES!
Even better for my purposes than a generalized distributed
notification (which could get pretty noisy!)
This will drive me to add a modicum of scriptability to my app, which
as you point out, will allow me to reuse this mechanism for other
mail clients down the road...
Thanks a TON!
Steve
On Nov 19, 2007, at 5:39 AM, has wrote:
Steve Cronin wrote:
I've checked around and I don't see any formal means to be notified
when a new piece of email is received.
Yes, I do realize the general problem of the many different mail
clients but my interest is (for now) in Mail.app.
Given that, what would be the general counsel for best way to keep
up-
to-date with new mail?
I have the AppleScript to get unread counts from any desired
mailbox, I'm thinking I should just run this AppleScript using
NSTimer.
Polling the unread count would be unreliable; e.g. users may get
and read new mails between polls.
AKAIF, the only formal notification mechanism in Mail is its rules
system. e.g. You could set up a Mail rule that runs an AppleScript
when new messages arrive (rule creation can be scripted if you want
to set this up automatically). That script could then send an Apple
event to your application informing it that new mail has arrived,
along with any information about the received messages that your
application might need.
Depending on your requirements it might be possible for some other
email clients to invoke the same API, which will simplify adding
support for those.
You'd need to say more about what your app does and how it needs to
interact with email clients to give more specific suggestions.
You might also file a feature request on Mail, asking that it send
a distributed notification when new mail arrives.
HTH
has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden