set folderToProcess to (choose folder with prompt "Choose folder to scan for apps:")
tell application "Finder"
activate
set nu_file to (choose file name)
set the_file to (open for access nu_file with write permission)
set fileExt to {".app"}
set theTopFolder to (folderToProcess as alias)
write (theTopFolder as text) & " [folder] " to the_file
repeat with EachFile in (get every file of folder (folderToProcess as alias))
try
copy name of EachFile as string to FileName
repeat with ext in fileExt
if FileName ends with ext then
write return & "•" & FileName to the_file starting at eof
end if
end repeat
end try
end repeat
repeat with EachSubDir in (get every folder of folder theTopFolder)
write return & (EachSubDir as text) & " [folder] " to the_file starting at eof
try
repeat with EachFile in (get every file of folder (EachSubDir as alias))
try
copy name of EachFile as string to FileName
--display dialog FileName
repeat with ext in fileExt
if FileName ends with ext then
write return & "••" & FileName to the_file starting at eof
end if
end repeat
end try
end repeat
end try
end repeat
close access theFile
say "Done."
end tell