Re: degrading script performance in Mail
Re: degrading script performance in Mail
- Subject: Re: degrading script performance in Mail
- From: deivy petrescu <email@hidden>
- Date: Sat, 27 Aug 2005 13:06:15 -0400
On Aug 27, 2005, at 11:45, patrick machielse wrote: Patrick, I've run
many times the following script
I'm trying to script Apple Mail 2.0.2. Essentially I want to set
the read status of all messages in a particular mailbox. As an
example, I use the following code:
tell application "Mail"
set read status of every message of mailbox "ADC" to false
end tell
"ADC" is a mailbox containing some 300 messages. The first time I
run this script after opening Mail it will complete in a matter of
seconds. However, the 5th run takes about a minute on my (slow)
machine, and performance only continues to degrade. I can actually
watch the blue dots being drawn in front of each message. Then
after all blue dots are there, spotlight runs (mds and mdimport)
for a while. During all this time you can not use other mailboxes;
Mail reports them as empty (which is quite scary).
Selecting the messages in Mail 'by hand' and using the menu to set
their read status remains equally fast, no matter how often you
use it, and also doesn't seem to trigger any indexing activity.
It this a bug in Mail, or is my script to naive?
If anyone can confirm or deny this behaviour I'd be much obliged...
patrick
Patrick, I've run many times the following script (in Smile, mind you)
<script>
chrono
tell application "Mail"
set l to name of every account
set j to item 1 of l as string
tell account j
set k to read status of every message of mailbox 1
end tell
end tell
return {chrono, count of k}
-- {0.430169999949, 1124}
</script>
So it takes 0.43 seconds to get the read status of 1124 messages.
consistent over many runs!
deivy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden