Re: Getting file list
Re: Getting file list
- Subject: Re: Getting file list
- From: kai <email@hidden>
- Date: Tue, 25 Nov 2003 00:58:34 +0000
on Mon, 24 Nov 2003 23:16:10 +0000, "applescript-talk"
<email@hidden> wrote:
>
Is there an easy way to get a list of files within a nest of folders,
>
maybe 2 or 3 deep?
In the Finder dictionary, under 'Containers and folders/container' you
should find a reference to this:
"entire contents: reference [r/o] -- the entire contents of the container,
including the contents of its children"
So this:
-------------------------
tell application "Finder" to entire contents of (choose folder)
-------------------------
...would return something like:
--> {file "Pict-1" of folder "FMP Pics Folder" of application "Finder", file
"Pict-2" of folder "FMP Pics Folder" of application "Finder", file "Pict-3"
of folder "FMP Pics Folder" of application "Finder"}
Depending on what you intend to do with the list, you may find a list of
aliases more useful. The Finder can help there, too:
-------------------------
set f to choose folder
tell application "Finder" to try
entire contents of f as alias list
on error
entire contents of f as alias as list
end try
-------------------------
--> {alias "Hard Disk:Desktop Folder:FMP Pics Folder:Pict-1", alias "Hard
Disk:Desktop Folder:FMP Pics Folder:Pict-2", alias "Hard Disk:Desktop
Folder:FMP Pics Folder:Pict-3"}
(The try block is normally required, since any attempt to coerce a
single-item list to an alias list usually results in an error - unless
things have changed in Panther.)
---
kai
_______________________________________________
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.