A friend asked me to hack together a script that will copy the names of all the files in the current folder *and* any subfolders. I'm still in the beginning stages, making sure I have the right terms and such. Here's my script so far:
tell application "Finder"
set currentDir to (target of front window)
display dialog (currentDir as text) & " has " & ((currentDir's items) count) & " items."
repeat with f in currentDir's items
display dialog name of f & "< " & (size of f as text)
repeat with p in properties of f
display dialog p as text
end repeat
end repeat
end tell
The problem is that, once that first display dialog appears and I dismiss it, Finder pops up instead of the Script Editor, and no other display dialog runs. It's as though Finder is showing me that front window instead of executing the "repeat" statements, for some reason. The path and count the initial dialog shows are correct, so that's working. Why then is Finder appearing, and no dialogs displaying at all? Related: if something like this already exists, can someone let me know and save me the time? I don't mind doing it, but I'd rather not re-invent the wheel. Thanks!
--
Have a great day,
Alex Hall