Re: Trying to get the path to every file in a folder - Help!
Re: Trying to get the path to every file in a folder - Help!
- Subject: Re: Trying to get the path to every file in a folder - Help!
- From: Michelle Steiner <email@hidden>
- Date: Thu, 23 Dec 2004 16:18:17 -0700
On Dec 23, 2004, at 4:06 PM, John Stewart wrote:
tell application "Finder" to set filesList to every file in
sourceFolder as alias list
This will error if there is only one file in the source folder.
Good point. I keep forgetting about that bug/feature because I
normally don't have folders with only one file in them.
This won't and you will still have a list of alias in filesList when
it's finished.
I think the following is a bit simpler; it returns a list of aliases;
if the folder is empty, it returns an empty list (it returns the empty
list even without the try statement).
set sourceFolder to choose folder
tell application "Finder"
try
set filesList to files of sourceFolder as alias list
on error
set filelist to files of sourceFolder as alias as list
end try
end tell
--
We're surrounded. That simplifies the problem.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden