• 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: 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


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

  • Prev by Date: 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: Trying to get the path to every file in a folder - Help!
  • Next by thread: Re: Trying to get the path to every file in a folder - Help!
  • Index(es):
    • Date
    • Thread