Re: file list with Finder
Re: file list with Finder
- Subject: Re: file list with Finder
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 12 Oct 2002 01:34:48 -0700
On 10/12/02 1:11 AM, "david" <email@hidden> wrote:
>
On Saturday, October 12, 2002, at 03:28 AM, Paul Berkowitz wrote:
>
>
SNIP.....
>
>
> In any case, if you are planning to use a recursive handler to go
>
> through
>
> the whole tree, why are you using 'entire contents'? It won't give you
>
> the
>
> means to do that.
>
>
.....SNIP
>
>
it seems the finder dictionary states:
>
>
entire contents reference [r/o] -- the entire contents of the
>
container, including the contents of its children
>
>
i'm assuming contents of its children would cover anything within the
>
container
Yes - if you're not interested in where they are, not actually interested in
the tree. 'entire contents' used to give false results in OS 8/9 when the
folder got too big - I'm not sure what the state of affairs is in OS X - I
think it may be fixed, and you get an out-of-memory error instead, which is
much better than a false result.
You can get entire contents but then you'll have to do a repeat loop on the
list it returns. One way, in the Finder, would be:
set theFolder to choose folder
tell application "Finder"
set allContents to (entire contents of theFolder)
set justFiles to {}
repeat with theItem in allContents
if kind of theItem is not "folder" then
set end of justFiles to (theItem as alias)
end if
end repeat
end tell
justFiles
But this will be faster, once it manages to get 'entire contents':
set theFolder to choose folder
tell application "Finder"
set allContents to (entire contents of theFolder)
end tell
set justFiles to {}
repeat with i from 1 to (count allContents)
set theItem to (item i of my allContents as string)
if theItem does not end with ":" then
set end of justFiles to (theItem as alias) -- or just theItem
end if
end repeat
justFiles
As you said, 'entire contents' is extremely memory-intensive, so it may not
always succeed.
--
Paul Berkowitz
_______________________________________________
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.