• 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: Problem with folder searching script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with folder searching script


  • Subject: Re: Problem with folder searching script
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 21 Oct 2004 20:24:04 -0700


On Oct 21, 2004, at 2:33 PM, John Goodchild wrote:

I am trying to write a script that searches the contents of a set of folders. When the script finds a folder, it processes the contents of that folder etc, etc.

Here is a template script that traverses folders.

set the topLevelFolder to (choose folder)

tell application "Finder"
	set foo to files of the topLevelFolder
	set bar to folders of the topLevelFolder
end tell
ProcessFiles(foo)
processFolders(bar)

to ProcessFiles(filesToBeProcessed)
	repeat with thisFile in the filesToBeProcessed
		-- do what you will with the files
	end repeat
end ProcessFiles

to processFolders(foldersToBeProcessed)
	repeat with thisFolder in foldersToBeProcessed
		tell application "Finder"
			set foo to files of thisFolder
			set bar to folders of thisFolder
		end tell
		ProcessFiles(foo)
		processFolders(bar)
	end repeat
end processFolders

--
I am Dyslexic of Borg. Fusistance is retile. Your ass will be laminated.

_______________________________________________
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: 
 >Problem with folder searching script (From: John Goodchild <email@hidden>)

  • Prev by Date: Re: Set Volume / Get Volume ?
  • Next by Date: Re: Legacy conversion of Quark 4 to InDesign 2 files question
  • Previous by thread: Problem with folder searching script
  • Next by thread: Re: Problem with folder searching script
  • Index(es):
    • Date
    • Thread