On Jul 30, 2011, at 19:22, Luther Fuller wrote:
There has been some commentary over the past few years that entire contents is slow. I have tested this, but only on a single message, not yet with a mailbox full of messages.
______________________________________________________________________
Hey Luther,
Eeek! 'Entire Contents' is still a dog. I quit Script Debugger after 1.5 minutes, and my Finder was running the SRWOD. I didn't feel like waiting for it to come to its senses, so I relaunched it.
Spotlight is much faster in Lion. The following code takes less than 1 second to find the target in a fairly large mail folder. Fairly large being about 1.31 GB.
On Snow Leopard this code was not nearly as fast, but it was acceptably fast.
--
Best Regards,
Chris
------------------------------------------------------------------------------------------------
# MDFIND (SPOTLIGHT)
------------------------------------------------------------------------------------------------
set applicationFolder to (POSIX path of (path to applications folder))
set userAppSupportFolder to quoted form of (POSIX path of (path to application support from user domain))
set userLibraryFolder to quoted form of (POSIX path of (path to library folder from user domain))
set userPrefsFolder to quoted form of (POSIX path of (path to preferences folder from user domain))
------------------------------------------------------------------------------------------------
set searchString to "118563.emlx"
set searchFolder to "/Users/chris/Library/Mail/V2/"
------------------------------------------------------------------------------------------------
set cmd to "mdfind -onlyin " & searchFolder & " \"kMDItemFSName == '" & searchString & "'c\""
# set cmd to "mdfind -onlyin " & searchFolder & " \"kMDItemDisplayName == '" & searchString & "'c\""
set reportText to do shell script cmd
------------------------------------------------------------------------------------------------