• 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: Searching in nested folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Searching in nested folders


  • Subject: Re: Searching in nested folders
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 6 May 2004 11:05:03 -0700

On May 6, 2004, at 10:28 AM, Bis wrote:

What I can't work out is a general algorithm which says:

1) get a list of all the items in the source folder
2) if any of the items is a quark file copy it to the destination folder
3) if any of the items is a folder get a list of its items
4) if any of these items is a quark file copy it to the destination folder

set the source_folder to choose folder
tell application "Finder"
set the File_list to the files of the source_folder
set the Folder_list to the folders of the source_folder
my copy_files(File_list)
my process_folders(Folder_list)
end tell

to copy_files(the_files)
--code to copy files goes here
end copy_files

to process_folders(the_folders)
tell application "Finder"
repeat with this_folder in the_folders
set these_files to the files of this_folder
my copy_files(these_files)
set these_folders to the folders of this_folder
my process_folders(these_folders)
end repeat
end tell
end process_folders

--
You can not change the world without perforce changing yourself.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Searching in nested folders
      • From: Bis <email@hidden>
References: 
 >Searching in nested folders (From: Bis <email@hidden>)

  • Prev by Date: Re: 7: AppleScript (FileMaker Developer 7)
  • Next by Date: XML/plist parsing (Was: 'info for' braindead...)
  • Previous by thread: Searching in nested folders
  • Next by thread: Re: Searching in nested folders
  • Index(es):
    • Date
    • Thread