On Jul 23, 2014, at 16:29, Bruce Robertson <email@hidden> wrote:And what's the syntax for "entire contents of" in this format? If the folder in question has folders within it? How would this statement be modified:
set myMoviesList to path of files of myMoviesfolder
______________________________________________________________________
Hey Bruce,
There is no entire contents of equivalent in System Events, and as you know entire contents of in the Finder is dreadfully slow when dealing with a file/folder group of any size at all.
I believe Shane's library here can be adapted to do the deed:
I thought he'd posted one to specifically return a recursive directory tree, but I can't seem to find it at the moment.
On the other hand if you don't have to contend with any package files 'find' in the shell is quick and flexible.
---------------------------------------------------------------------- set testFolder to quoted form of (POSIX path of (path to movies folder))
set cmdStr to "find " & testFolder & " -type f -iname \"*.mp4\"" set movieList to do shell script cmdStr if movieList ≠ "" then set movieList to paragraphs of movieList end if ----------------------------------------------------------------------
Using -type f to specify files is probably overkill in this case, since it's unlikely that a directory name would end in ".mp4". But what the heck.
-- Best Regards, Chris
|