• 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: Get every file of the entire contents of a folder. Quickly.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get every file of the entire contents of a folder. Quickly.


  • Subject: Re: Get every file of the entire contents of a folder. Quickly.
  • From: Arthur Knapp <email@hidden>
  • Date: Tue, 14 Oct 2003 13:24:31 -0400

Date: Tue, 14 Oct 2003 06:57:42 +0100
Subject: Re: Get every file of the entire contents of a folder. Quickly.
From: kai <email@hidden>

on Mon, 13 Oct 2003 16:57:03 -0400, Paul Skinner wrote:

In trying 'entire contents of' and Satimage's 'list files' I am left
unsatisfied. I won't even try recursing the directories in AppleScript

I just threw this together with minimum testing, let me know how it
does if your interested:

on FastDirFiles(f)

set a to {}

script o
on h(f)
set AppleScript's text item delimiters to "::"
tell application "Finder" to set s to every file of folder f as string
if (s's length > 0) then set a to a & s's text items
tell application "Finder" to set s to every folder of folder f as string
set AppleScript's text item delimiters to ":::"
if (s's length > 0) then repeat with i from 1 to count text items in s
h(s's text item i)
end repeat
end h
end script

(* Normalize an alias, fss, path-string, or
* Finder object reference to a path-string.
*)
set f to f as alias as string

set tids to AppleScript's text item delimiters

o's h(f)

set AppleScript's text item delimiters to tids

return a

end FastDirFiles

FastDirFiles(choose folder)

It will fail if any one folder contains more than around 4050 some files
or folders, but that problem is always easily correctable via the now
numerous handlers for working around this limitation.

{ Arthur J. Knapp;
<mailto:email@hidden>;

What...? Oh...!
}
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: 'help'
  • Next by Date: Re: forwarding in Eudora II
  • Previous by thread: Re: Get every file of the entire contents of a folder. Quickly.
  • Next by thread: Re: Get every file of the entire contents of a folder. Quickly.
  • Index(es):
    • Date
    • Thread