• 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 list as data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file list as data


  • Subject: Re: file list as data
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 24 Jul 2014 04:12:17 -0500

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:

http://lists.apple.com/archives/applescript-users/2014/Jul/msg00012.html

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

 _______________________________________________
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: file list as data
      • From: Shane Stanley <email@hidden>
References: 
 >Re: file list as data (From: "Jan E. Schotsman" <email@hidden>)
 >Re: file list as data (From: Bruce Robertson <email@hidden>)

  • Prev by Date: Re: file list as data
  • Next by Date: Re: file list as data
  • Previous by thread: Re: file list as data
  • Next by thread: Re: file list as data
  • Index(es):
    • Date
    • Thread