sort folder by modification date

I need to sort a folder by modification date. Here is what I have but does not work

tell application "Finder" to tell Finder window 1
	
	tell its list view options
		set sort column to column modification date
	end tell
	
	set currentFolder to target
	close
	open currentFolder
	
end tell

This works under Catalina. The only change I made to your script was to add column after modification date.

tell application "Finder" to tell Finder window 1
	
	tell its list view options
		set sort column to column modification date column
		-- set sort column to column id modification date column -- alternative if above doesn't work.
	end tell
	
	set currentFolder to target
	close
	open currentFolder
	
end tell

BTW, you may want to look at KniazidisR’s helpful response to your following thread–it contains useful information on this topic.

https://macscripter.net/viewtopic.php?id=47645

thank you, can’t thank you enough. I do audio editing for TV. Its not the high tech audio magic I do, its all about the files and folders. Applescript does so much for me so I practically do not have to click. Thanks again. Have a blessed day.