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: Andrew Oliver <email@hidden>
- Date: Thu, 23 Dec 2004 11:06:50 -0800
On 12/23/04 10:48 AM, "Geoffrey Dudgeon" <email@hidden> wrote:
> Hey everyone!! I'm trying to write an applescript that will take a
> folder and email all of its contents as attachments of separate emails.
> The problem I've run into is in creating a list of the paths of every
> file. Getting a path compiles but returns an applescript error.
> Meanwhile, getting a container compiles and runs without error, but
> obviously isn't the command I want.
>
> Does anyones know how I should solve this problem?
> Is there a way to get the paths without returning an applescript error?
> Or should I approach the problem by getting the container and somehow
> appending the name of the file?
>
> 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
[snip]
'path of every file in sourceFolder' is not going to work. The Finder
doesn't have a 'path' property for files.
Additionally, mail.app wants aliases when defining attachments, not text
strings (which is what I'd assume a 'path' would be, if it existed.
Instead, just:
set filesList to every file in sourceFolder as alias list
This will return a list of aliases which you can use in Mail.app.
Andrew
:)
_______________________________________________
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