Sort!?

I can’t understand why this is not working?

set myFolder to choose folder with prompt "Select the folder containing the files you want to place."
tell application "Finder"
	set myFiles to files of myFolder
	set myFiles to sort files of myFolder by name 
end tell

Dictionary says:
Sort

sort (verb)Return the specified object(s) in a sorted list (from the Finder Basics suite)

Function Syntax
set theResult to sort reference ¬
by property

Result
reference: the sorted items in their new order

Parameters
Parameter Required Type Description
direct parameter required reference a list of finder objects to sort
by required property the property to sort the items by (name, index, date, etc.)

Hi, Kari.

sort does now actually require a list of Finder items to sort. It can’t take a collective Finder reference as it used to in OS 9 and earlier.

set myFolder to choose folder with prompt "Select the folder containing the files you want to place."
tell application "Finder"
	set myFiles to files of myFolder -- Resolve the reference 'files of myFolder' into a list.
	set myFiles to sort myFiles by name -- Sort the list.

	-- Or:
	-- set myFiles to sort (get files of myFolder) by name
end tell

Thank you for your valuable time.