My script for archiving Mail messages has taken a major performance hit under Lion. Here’s the relevant bit:
tell application "Mail"
repeat with thisMessageViewer in message viewers
if window of thisMessageViewer is first window then
set theSelectedMessages to selection
if theSelectedMessages is {} then
return
end if
repeat with theMessage in theSelectedMessages
set theAccount to name of account of mailbox of theMessage
move theMessage to mailbox "Archive" of account theAccount
end repeat
return
end if
end repeat
end tell
For me, it’s taking anywhere between 2-20 seconds to complete the “move theMessage…” line. And on my machine, this was a sub-second task in Snow Leopard (it could process >10 messages per second).
Can anyone confirm whether this is a Lion issue, and is there a faster syntax for dealing with the “move” command?
Thanks!