• 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
Dealing with packages: files or folders?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dealing with packages: files or folders?


  • Subject: Dealing with packages: files or folders?
  • From: "Gregory J. Smith" <email@hidden>
  • Date: Wed, 27 Jul 2005 18:47:26 -0600

So I want to get the contents of some packages and do things with them. However my recursive code dies because, apparently, applescript doesn't know what to do with the packages. Suggestions?

set main_folder to (choose folder)
set list_of_files to ProcessFolder(main_folder)
----------
-- recursive subroutineon ProcessFolder(the_folder)
    set file_list to {}
    tell application "Finder"
        try
            set file_list to (name of every file of the_folder)
        on error -- there are no files of this type
            -- do nothing
        end try
        set folder_list to (every folder of the_folder)
    end tell
    repeat with this_folder in folder_list
        set file_list to file_list & ProcessFolder(this_folder)
    end repeat
    return file_list
end ProcessFolder


Gregory J. Smith email@hidden http://homepage.mac.com/gregjsmith



_______________________________________________
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: Dealing with packages: files or folders?
      • From: Christopher Nebel <email@hidden>
    • Re: Dealing with packages: files or folders?
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: Really dumb question . . .
  • Next by Date: Re: Applescript-users Digest, Vol 2, Issue 492
  • Previous by thread: Script editor feature
  • Next by thread: Re: Dealing with packages: files or folders?
  • Index(es):
    • Date
    • Thread