(* Finder: Change List view options
https://discussions.apple.com/thread/3533331, 2011
Works with Sonoma 14.7.1
*)
tell application "Finder"
activate
tell the front Finder window
set the current view to list view
end tell
tell list view options of front Finder window
set width of column name column to 250
end tell
tell application "System Events" to tell process "Finder"
tell menu item "Show View Options" of menu of menu bar item "View" of menu bar 1 to if exists then click
tell checkbox "Date Modified" of group 1 of window 1 to if value is 0 then click
tell checkbox "Date Created" of group 1 of window 1 to if value is 0 then click
tell checkbox "Date Last Opened" of group 1 of window 1 to if value is 0 then click
tell checkbox "Date Added" of group 1 of window 1 to if value is 0 then click
tell checkbox "Size" of group 1 of window 1 to if value is 0 then click
tell checkbox "Kind" of group 1 of window 1 to if value is 0 then click
tell checkbox "Version" of group 1 of window 1 to if value is 0 then click
tell checkbox "Comments" of group 1 of window 1 to if value is 0 then click
tell checkbox "Tags" of group 1 of window 1 to if value is 0 then click
end tell
tell the front Finder window
set the index of column size column to 2
end tell
end tell
Something like this - the only lines changed are the last few. I can’t test it right now, so it might not work.
tell application "Finder"
activate
tell the front Finder window
set the current view to list view
end tell
tell list view options of front Finder window
set width of column name column to 250
end tell
tell application "System Events" to tell process "Finder"
tell menu item "Show View Options" of menu of menu bar item "View" of menu bar 1 to if exists then click
tell checkbox "Date Modified" of group 1 of window 1 to if value is 0 then click
tell checkbox "Date Created" of group 1 of window 1 to if value is 0 then click
tell checkbox "Date Last Opened" of group 1 of window 1 to if value is 0 then click
tell checkbox "Date Added" of group 1 of window 1 to if value is 0 then click
tell checkbox "Size" of group 1 of window 1 to if value is 0 then click
tell checkbox "Kind" of group 1 of window 1 to if value is 0 then click
tell checkbox "Version" of group 1 of window 1 to if value is 0 then click
tell checkbox "Comments" of group 1 of window 1 to if value is 0 then click
tell checkbox "Tags" of group 1 of window 1 to if value is 0 then click
end tell
set the index of column size column to 2
end tell
I have figured it out, but I need anoter help (see below)
tell application "Finder"
activate
tell the front Finder window
set the current view to list view
end tell
tell list view options of front Finder window
set width of column name column to 250
end tell
tell application "System Events" to tell process "Finder"
tell menu item "Show View Options" of menu of menu bar item "View" of menu bar 1 to if exists then click
tell checkbox "Date Modified" of group 1 of window 1 to if value is 0 then click
tell checkbox "Date Created" of group 1 of window 1 to if value is 0 then click
tell checkbox "Date Last Opened" of group 1 of window 1 to if value is 0 then click
tell checkbox "Date Added" of group 1 of window 1 to if value is 0 then click
tell checkbox "Size" of group 1 of window 1 to if value is 0 then click
tell checkbox "Kind" of group 1 of window 1 to if value is 0 then click
tell checkbox "Version" of group 1 of window 1 to if value is 0 then click
tell checkbox "Comments" of group 1 of window 1 to if value is 0 then click
tell checkbox "Tags" of group 1 of window 1 to if value is 0 then click
end tell
tell application "System Events" to tell process "Finder"
click (first button of window 1 whose description is "close button")
end tell
tell list view options of front Finder window
set the index of column size column to 2
end tell
end tell
So, now it works, but to really see the columns have been rearranged, it is required to “update” them somehow. For example, you can visit another directory and then return back. That is, once you return back, you will see the “Size” column is now the 2nd one. But of course, I would like to automate it somehow. I tried
tell application "Finder" to tell front window to update every item