Sort Finder and adjust columns in Sequoia

Years ago I found this script that has worked fine in the latest versions of MacOs, but in Sequoia it no longer works.

It sorts Finder items by name and adjusts the size of the columns.

I would appreciate help in making the necessary corrections to get it to work correctly on MacOS 15.0.1.

tell application "Finder"
	activate
end tell

tell application "Finder"
	activate
	tell list view options of the front Finder window 
		
		set properties to {calculates folder sizes:false, shows icon preview:false, icon size:small icon, text size:12, uses relative dates:true, sort column:name column}
		
		tell column name column
			set properties to {index:1, sort direction:normal, width:280}
		end tell
		
		tell column size column
			set properties to {index:2, sort direction:normal, width:72, visible:true}
		end tell
		
		tell column modification date column
			set properties to {index:3, sort direction:normal, width:120, visible:true}
		end tell
		
		tell column creation date column
			set properties to {index:4, sort direction:normal, width:120, visible:true}
		end tell
		
		tell column kind column
			set properties to {index:5, sort direction:normal, width:120, visible:true}
		end tell
		
		tell column label column
			set properties to {index:6, sort direction:normal, width:72, visible:false}
		end tell
		
		tell column version column
			set properties to {index:7, sort direction:normal, width:72, visible:false}
		end tell
		
		tell column comment column
			set properties to {index:8, sort direction:normal, width:240, visible:false}
		end tell
		
		set sort column to size column
		
		
	end tell
	
	tell the front Finder window
		set current view to list view
		set zoomed to false
	end tell
	
end tell

``
1 Like

Without knowing a clear reason, the script is working perfectly again.

DJUNQUERA. Your script does not work on my Sequoia computer. The following does work FWIW.

tell application "Finder"
	activate
	tell list view options of the front Finder window
		set properties to {calculates folder sizes:false, shows icon preview:false, icon size:small icon, text size:12, sort column:name column, uses relative dates:true}
		
		tell column name column
			set properties to {index:1, sort direction:normal, width:280}
		end tell
		
		tell column size column
			set properties to {index:2, sort direction:normal, width:72, visible:true}
		end tell
		
		tell column modification date column
			set properties to {index:3, sort direction:normal, width:120, visible:true}
		end tell
		
		tell column creation date column
			set properties to {index:4, sort direction:normal, width:120, visible:true}
		end tell
		
		tell column kind column
			set properties to {index:5, sort direction:normal, width:120, visible:true}
		end tell
		
		tell column label column
			set properties to {index:6, sort direction:normal, width:72, visible:false}
		end tell
		
		tell column version column
			set properties to {index:7, sort direction:normal, width:72, visible:false}
		end tell
		
		tell column comment column
			set properties to {index:8, sort direction:normal, width:240, visible:false}
		end tell
		
		--set sort column to size column --conflicts with setting in list view options
	end tell
	
	tell Finder window 1
		set current view to list view
		--set zoomed to false --breaks the script
		set currentFolder to target
		set target to path to public folder
		try
			set target to currentFolder
		on error
			openComputerContainer() of me
		end try
	end tell
end tell

on openComputerContainer()
	tell application "System Events" to tell process "Finder"
		click menu item "Computer" of menu "Go" of menu bar 1
	end tell
end openComputerContainer