Process recursivelly dropped files/folders

You can use this set of handlers to process any files/folders dropped into your droplet, which will search recursivelly every file and apply your code.
It is very fast, since it doesn’t use the “info for” command to determine if the item is a folder or file.

OS version: Any

on open aliasList
	repeat with i in aliasList
		processUnknownItem(i)
	end repeat
end open

to processUnknownItem(thisItem)
	if (thisItem as text) ends with ":" then
		processFolder(thisItem)
	else
		processFile(thisItem)
	end if
end processUnknownItem

to processFolder(thisFolder)
	--> you can manipulate this folder adding code here
	set itemList to list folder thisFolder without invisibles
	repeat with i in itemList
		processUnknownItem(alias ((thisFolder as text) & i))
	end repeat
end processFolder

to processFile(thisFile)
	--> you can manipulate this file adding code here
end processFile