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

Re: file references


  • Subject: Re: file references
  • From: Luther Fuller <email@hidden>
  • Date: Thu, 15 Nov 2012 12:35:56 -0600

On Nov 15, 2012, at 12:13 PM, Jim Brandt wrote:
For a "large" directory (220 files and folders), several folders deep, the Finder took 25 seconds to return this list while System Events only took < 1 second.
If I then have to jump through hoops to use that reference though, I'll probably try a different way. (I'm leaning towards a Unix "ls" command).

Using 'ls' is a good way to lean. Using 'find' is also a good way to lean.
I use a variation on the handler, below, to get an alias to every mail file in a mailbox (.mbox) folder no matter how deeply nested. (.mbox folders in Lion have a complicated structure.)

on getFileAliasList(folderAlias)
set AppleScript's text item delimiters to {return}
--
quoted form of (POSIX path of folderAlias)
do shell script "find " & the result & " -name '*.emlx'"
set fileList to (text items of the result)
--
repeat with i from 1 to (count items of fileList)
(POSIX file (item i of fileList)) as alias
set item i of fileList to the result
end repeat
return fileList
end getFileAliasList --------------------------------------

And this handler seems to be extremely fast in Lion. You will have to read the help for 'find' to understand how to get the files you want.


 _______________________________________________
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

References: 
 >file references (From: Jim Brandt <email@hidden>)

  • Prev by Date: Re: file references
  • Next by Date: Scripting Word 2011
  • Previous by thread: Re: file references
  • Next by thread: Re: file references
  • Index(es):
    • Date
    • Thread