• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: email
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: email


  • Subject: Re: email
  • From: Chris Page <email@hidden>
  • Date: Sat, 31 May 2008 18:23:30 -0700

On May 28, 2008, at 08:02 AM, Jens Alfke wrote:

Importing messages from Mail via AppleScript may not be fast enough — my highly scientific estimate* is "a couple of messages" a second. Importing someone's entire mail archive would take a long time.


I just did a test and it's quite fast if you ask for all the messages at once:

tell application "Mail"
	repeat with box in mailboxes
		set n to count messages of box
		log "Importing " & n & " messages from “" & (name of box) & "”"
		set startTime to current date
		get the source of every message of box
		set elapsedTime to (current date) - startTime
		log "Total: " & elapsedTime
		if n is not 0 then
			log "Average: " & elapsedTime / n
		end if
	end repeat
end tell

I'm seeing average times of one to two milliseconds per message (e.g., 7 seconds for a mailbox with 4,660 messages) on a 2.5GHz Quad G5.

Be sure not to run this with event result logging turned on in Script Editor, although even with event logging turned on that same mailbox only takes 30 seconds or just over 6 milliseconds per message.

--
Chris Page - AppleScripter

 The other, other AppleScript Chris

_______________________________________________

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


References: 
 >email (From: email@hidden)
 >Re: email (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Loops in Objective C?
  • Next by Date: Re: RESTful API's - Easy way to interact?
  • Previous by thread: Re: email
  • Next by thread: Re: email
  • Index(es):
    • Date
    • Thread