Jens Alfke wrote:

On 28 May '08, at 4:38 AM, [EMAIL PROTECTED] wrote:

I've build an email application,which doesn't using any email
clients.In this application i've to extract emails and email addresses
from other email clients(example mail.app,entourage etc).

Importing messages from Mail via AppleScript may not be fast enough —
my highly scientific estimate* is "a couple of messages" a second.

Not quite that bad. For example, getting all recipient names and addresses from the 'sent mailbox' on my 2.4GHz dual core MBP:

set t to AMTime
tell application "Mail"
set {n, a} to {name, address} of every recipient of every message of sent mailbox
end tell
set t to (AMTime) - t
return {durationInSeconds:t, messageCount:count n, names:items 1 thru 3 of n, addresses:items 1 thru 3 of a}

Typical result:
        durationInSeconds:1.332630157471,
        messageCount:1594,
        names:{{"John Brown"}, {"Jane Black", "Bob Green"}, {missing value}},
addresses:{{"[EMAIL PROTECTED]"}, {"[EMAIL PROTECTED]", "[EMAIL PROTECTED]"}, {"[EMAIL PROTECTED] "}}}

Of course, you still have to flatten and recompose the lists, remove duplicate entries and maybe sort the rest into a sensible order, but you'll be quicker doing that in ObjC if you can.

What'll be best in practice really depends on the OP's requirements - e.g. will they hardwire the import code for each mail client into their application, or implement it as as user-customisable plug-in system - but if they want specific recommendations they'll need to give more details.

HTH
has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to