How to find out what files are in a folder

How can I list all the files in a specified folder and put them in a list so I can run through them an process each one?

This should do it:

set thelist to list folder (choose folder)
repeat with thefile in thelist
	if (thefile as text) ends with ":" then
		--is folder
	else
		--is file
	end if
end repeat
end