Applescript to work around a Finder bug in Mavericks

Mavericks introduced several bugs into the Finder. One of them is that in List View, the Finder frequently loses track of the column widths, and makes the Name column so wide that the other columns aren’t visible unless one scrolls the window horizontally.

The following Applescript resets the column widths to something sensible. It uses a couple kludges to work around some *other* Finder bugs that Mavericks introduced.

— Reset the width of the Finder’s Name column to something sensible.
tell application “Finder”
set thisFolder to target of front Finder window
set the current view of front Finder window to list view
— In previous versions of OS X, the next line would tell the Finder to set the width
— to exactly 300. In Mavericks, the Finder uses it as a *minimum* width.
set width of column id name column of list view options of Finder window 1 to 300
— The following kludge is necessary to get the changes to “take”. I got it from
— Dr. Drang at www.leanc …

Source: Mac OSX Hints