Finder: Resize Name-Column To-Fit

Hey Folks,

For years now I've had a macro to resize the name column of the front Finder window (in list-view) to fit — with a Hot Key Trigger.

For those who don't know — by double-clicking on the resize-widget between the column-headers, you can cause the leftmost column to resize to fit its longest element.

The macro is faster if the AppleScript is a compiled script, and I have provided one in a zip file along with the Keyboard Maestro macro. (You can open the script in the Script Editor to see what it's doing.)

This macro will only work with Yosemite (10.10.x) at this time.

On my system it's even faster than the Mavericks version was.

-Chris

Window { Resize Name Column }.scpt.zip (9.5 KB)
Window { Resize Name Column } Yosemite.kmmacros (3.3 KB)

3 Likes

Hi Chris, Is this working for you under El Capitan 10.11.6?

As far as I can see, option-double-clicking on column the separators no longer resizes all columns, it only resizes one column to fit. So this may not actually solve the original problem.

Hey @skillet,

It works for me.

But. There are odd conditions where it won't work that depend upon window-width and how many columns are showing in list-view.

I don't recall that ever being true in list-view. I do believe it once was in column-view though.

-Chris

That must be the problem I have several columns showing. I guess I just stick with these in the meantime.

Examples - Skillet Macros - Resize Column.kmmacros (103.1 KB)

Thanks Chris, I just came back to this after thinking I almost found a solution it seems like this AppleScript should work but doesn't.

tell application "Finder"
   set listView to target of front Finder window
   set the current view of front Finder window to list view
   set width of column id name column of list view options of front Finder window to 400
   set width of column id modification date column of list view options of front Finder window to 150
   --etc.
   close front Finder window
   open listView
end tell

I put your AppleScript in my Dropbox folder so it syncs across multiple Macs and added change Finder to List View. Not sure if either of those ideas present other problems though.

Hey @skillet,

Try this:

----------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2018/01/04 20:10
# dMod: 2018/01/04 20:16 
# Appl: Finder
# Task: Adjust widths of the name column and the mod date column in the front window.
# Libs: None
# Osax: None
# Tags: @ccstone, @Applescript, @Script, @Finder, @Adjust, @Widths, @Name, @Column, @Modification, @Date, @Front, @Window
----------------------------------------------------------------
property nameColumnWidth : 400
property modDateColumnWidth : 150
----------------------------------------------------------------

set otherTarget to path to favorites folder -- For use in getting the view to reset.

tell application "Finder"
   
   set winTarget to target of front window as alias
   
   tell front window
      if its current view ≠ list view then set its current view to list view
      
      tell its list view options
         set width of column id name column to nameColumnWidth
         set width of column id modification date column to modDateColumnWidth
      end tell
      
      -- etc.
      
      set target to otherTarget
      delay 0.05
      set target to winTarget
      
   end tell
   
end tell

----------------------------------------------------------------

-Chris

Chris

Just implemented this. After years of being frustrated by the narrow columns. Don't know what took me so long to search KM.

However I can't seem to change "nameColumnWidth." Seems to be stuck on the initial 400 value that you had. I'm going to restart Finder and see if that helps. No change. I'll play with it. I am trying for something like 250 width. Maybe it has something to do with the fact that I've added your script to an "Activate Finder" action.

Thanks for posting this script.

Hey @KBM,

Hmm...

You've tried running the script exactly as is except for changing the nameColumnWidth variable?

property nameColumnWidth : 250

-Chris

The change to 400 seems to be permanent. If I open a new Finder window, it comes up 400. If I close all Finder windows, open a new one, reduce the first column to say 50 pixels and open another Finder window it comes up 400. Better than the tiny width I had before.

I also tried running the script from Script Editor. Wouldn't work if no window was opened and if a window was opened it changed that window to 400.

Hey @KBM,

I didn't have the script check to make certain a window was open, although perhaps I should have.

The macOS plays funny games with the name column width when the window is of a certain size and you have too few columns shown in the window.

Try playing with the window width and adding a couple or three more columns to the window.

-Chris

Thanks

With a total of 7 columns no difference.

Maybe I'll work on it later, but 400px is better than the narrow column I had before. Good enough for now.

I keep coming back to this and curious if anyone has a solution to this age old problem. It has never consistenly worked and I have had to use Keyboard Maestro to bypass errors I get. I have not been able to have this work in Sonoma MacOS 14 at all. I really wish Apple would implement a preference to auto resize name column to show all the file names full width. Yes this would mean it constantly resizes but that's okay it's a preference after all.

1 Like

waiting for this as well

Maybe some of you are using List View, but if you use Column View, it's simple: just have your macro option-double-click the separator using Found Image.

Been doing this since 2019 (on Monterey 12.7 at the moment):

(One step each for Light and Dark mode)

Finder Column Auto-resizer.kmmacros (29.2 KB)