• 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: entire contents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: entire contents


  • Subject: Re: entire contents
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 13 Sep 2011 17:47:08 -0500

Here is the slow code that was causing the 20 sec delay per item ...

tell application "Finder"
try
mboxPath as alias
(some folder of the result whose name extension is not "mbox") as alias
some file of entire contents of the result whose name is msgFileName
return the result as alias
end try
end tell

I took advantage of the fact that the file msgFileName is always
contained in a folder named "Messages" and tried this code ...

tell application "Finder"
try
mboxPath as alias
(some folder of the result whose name extension is not "mbox") as alias
set msgFolderList to (every folder of entire contents of the result whose name is "Messages") as alias list
repeat with msgFolder in msgFolderList
try
(file msgFileName of msgFolder) as alias
return the result
end try
end repeat
end try
end tell

It works! Very fast, in fact.
I could have rewritten as something similar that searches all sub-folders recursively and I suspect that it would also be acceptably fast.

So why can't entire contents be fixed to eliminate all those dangerous symptoms?

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: entire contents
      • From: Luther Fuller <email@hidden>
    • Re: entire contents
      • From: Christopher Stone <email@hidden>
References: 
 >entire contents (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Passing a Handler at Runtime
  • Next by Date: Re: Passing a Handler at Runtime
  • Previous by thread: entire contents
  • Next by thread: Re: entire contents
  • Index(es):
    • Date
    • Thread