On Apr 8, 2010, at 2:37 PM, Thomas Fischer wrote: So the distinction is really in the clause "whose visible is true"
The phrase "whose visible is true" is not required by Finder, but in System Events this is required and if you don't use it, you get some unwanted items in the list of items which you then have to script around.
I was using the line ...
if (exists (some document file of entire contents of sourceFolder whose modification date < cutoffTime)) then
in my script and was getting acceptable results. I had to remove it because in extreme cases, i.e. sourceFolder contains 1000s of files, it failed. It seems that both entire contents and whose ... cause slowness.
There is an interesting background story here. I should tell it ...
On 1 April, I released a shareware application called MailWing 4.0. On 2 April, the following comment appeared at MacUpdate:
When I got it running, it was taking 10 sec per email message when working on 8000 messages, and no use of Mail is possible while waiting.
I have a .mbox folder containing about 1600 messages that I use for testing, so I imported it into Mail, then tried, using MailWing, to move the mailbox to a folder. He's right, when the folder grows to about 1000 files, it slows to about 10 sec per message.
MailWing was NOT designed to write to a folder containing 1000s of messages and 8000 is excessive in the extreme. I suspect that the user was trying to avoid paying $9.95 by using the demo mode to save a large mailbox to a Finder folder. But, the customer is always right, so I spent all day, 4 April, removing a few commands that worked OK unless moving files to a large folder. I've used it for years while developing it and I never had a problem. Version 4.0.1 has been fixed so that it's speed is now acceptable even when copying files to large folders. I released MailWing 4.0.1 on Monday 5 April.
I sometimes see reports of someone having a mailbox containing tens of thousands of messages and I am amazed that Mail still works ... but then I use MailWing, so I rarely have more than 200 messages in Mail. MailWing archives all my old mail to a sparsebundle archive.
|