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.)