• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trying to get the path to every file in a folder - Help!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Trying to get the path to every file in a folder - Help! (From: Geoffrey Dudgeon <email@hidden>)

  • Prev by Date: Re: Trying to get the path to every file in a folder - Help!
  • Next by Date: Re: Trying to get the path to every file in a folder - Help!
  • Previous by thread: Re: Trying to get the path to every file in a folder - Help!
  • Next by thread: Driving Java App with Applescript, begining
  • Index(es):
    • Date
    • Thread