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 12:01:56 -0700
On Dec 23, 2004, at 11:48 AM, Geoffrey Dudgeon wrote:
tell application "Finder"
--the user inputs the source folder
set sourceFolder to (choose folder with prompt "Select a folder to
begin:")
set filesList to path of every file in sourceFolder
First of all, get rid of the tell application "Finder" wrapper.
Secondly, "every file of" returns the paths as Finder objects. So
"path of" generates an error because you can't get a path of a path.
Secondly, mail.app doesn't understand Finder objects, so you need to
coerce them into aliases. So, the code that you need is this:
--the user inputs the source folder
set sourceFolder to (choose folder with prompt "Select a folder to
begin:")
tell application "Finder" to set filesList to every file in
sourceFolder as alias list
-- Michelle
--
I love my country; I'm just ashamed (and afraid) of its current
government.
_______________________________________________
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