Trying to count items in a folder with > than 2 characters in name

I am trying to get the count of the number of items (folders) in a folder that have names longer than a certain number of characters (2 in this case) and set that count to a variable.

This is what I currently have:

	tell application "Finder" to set f to the count of every folder of the entire contents of folder ReturnsFolderPath where the ((count of characters of name of every folder of the entire contents of folder ReturnsFolderPath) is greater than 2)

which returns an error of: “Can’t get 2 whose 0 > 2.”

Thanks!

There’s nothing gained by cramming everything into one statement. Try something like this:

set RFP to choose folder
tell application "Finder" to set f to (folders of the entire contents of RFP as alias list)
set c to 0
repeat with n in f
	if length of (name of (info for n)) > 7 then set c to c + 1
end repeat
c

Perfect, beautiful.
Thanks so much!