what makes this droplet return extra info
what makes this droplet return extra info
- Subject: what makes this droplet return extra info
- From: "Feldman, Don" <email@hidden>
- Date: Tue, 14 Aug 2001 11:03:07 -0400
Here's a shortened version of a droplet I asked about a few days ago. It
goes through a folder and get the file type of all the files in the folder
using a recursion routine I modeled after one of Bill Briggs Primer
articles. This is so it can search folders and files buried down to the
bottom folder. He explained (on this email site) that I needed to
accommodate the list returned from a droplet differently then the alias from
a choose statement. I tried that, but I may still be missing something since
the on-run handler returns a shorter list of items than the droplet. Can
anybody tell me what I'm missing?
on open folderList
set finalData to {}
repeat with currentItem from 1 to count of folderList
set allFiles to item currentItem of folderList
parseFiles(allFiles)
end repeat
end open
on run
set finalData to {}
set folderList to (choose folder)
parseFiles(folderList)
end run
on parseFiles(allFiles)
set finalData to {} --probably does nothing
dumpFiles(allFiles)
set theTypes to result
display dialog theTypes as string
end parseFiles
on dumpFiles(whatsPassed)
tell application "Finder"
set another to the file type of every item of whatsPassed whose kind
is not "folder"
set folderContents to (every item of whatsPassed)
repeat with anItem in folderContents
my dumpFiles(anItem)
end repeat
try
set my finalData to my finalData & another
on error errMsg number errNum
display dialog errMsg & " " & errNum & " Call the fire
department"
end try
end tell
end dumpFiles