Droplet doesn't always work

I have a droplet that only affects files dropped onto it, If I drop a folder with files inside of it…there is no effect
Does anyone have a tip on helping me make this droplet work on anything dropped on (files, folders, files inside of folders, folders inside of folders)

on open (listFiles)
–Call To Check Name Length For Max Allowed, And If Too Long Ask User To Rename–
tell application “Finder”
my setName(listFiles)
end tell

--Clean Any Illegal Characters Out Of Name--
tell application "Finder"
	repeat with i from 1 to count of listFiles
		set elem to (item i of listFiles) as string
		set fileItem to alias elem
		set strName to name of fileItem
		set replace_strings to �
			{" ", "  ", "-", "_", "__", "~", "`", ":", ";", "!", "@", "�", "'", "�", "#", "$", "?", "<", ">", "%", "^", "&", �
				"*", "(", ")", "=", "+", "{", "}", "[", "]", "|", "\", "/", "'", ",", """}
		repeat with this_replace_string in replace_strings
			set strName to my FixName(strName, (contents of this_replace_string))
		end repeat
		set name of fileItem to strName
	end repeat
end tell

end open

on FixName(currentName, fixString)
set AppleScript’s text item delimiters to fixString
set listName to every text item of currentName
set AppleScript’s text item delimiters to “_”
return (listName as string)
end FixName

–Direct Controller for Name Length–
on setName(fileList)
tell application “Finder”
repeat with thisItem in fileList
set item_name to name of thisItem
set item_container to container of thisItem as string
if kind of thisItem is not “Folder” then
set name_length to count item_name
if name_length > 27 then
set the_error to "This file’s name has too many characters. It has " & name_length & " characters, but the limit is " & 27 & " total. "
repeat
set item_name to text returned of (display dialog the_error & “Please enter a new name:” buttons {“Proceed”} default button 1 default answer item_name)
set the_error to “”
set name_length to count item_name
if name_length > 27 then
set the_error to "This file’s name has too many characters. It has " & name_length & " characters, but the limit is " & 27 & " total. "
else
try
get (item_container & item_name) as alias
set the_error to "A file with the name “” & item_name & “” already exists. "
end try
end if
if the_error = “” then exit repeat
end repeat
set name of thisItem to item_name
end if
end if
end repeat
end tell
end setName

Search the board for “recursion” of “recursive”.

Jon

Take a look at this too.

http://macscripter.net/exchange/index.php?id=P173

– Rob

You might also try the Finder’s handy ‘entire contents’ object.

entire contents of alias someFolderPath