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)

4 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)

Thanks, for the post. Same and I have never been able to get the double click like that to work for image consistently with List view which is where I mostly live. I usually have Date Added as the second item next to name so double clicking the column header is what I usually have to do. I think I will add a hybrid of command+3 to the column view macro so it just does that when I switch to that view.
Apple - Finder Macros.kmmacros (72.3 KB)

Perhaps I'm missing something here, but why use image detection? It seems that all you need to do is get the position of the divider at the end of the name column then tell KM to double-click there.

Making the assumption that "Name" is column 1 and with no error checking (that can all be had from @ccstone's script -- Chris is better at that than me!).

Finder -- expand column 1.kmmacros (3.8 KB)

Image

This is working consistently for me in Sonoma, with a couple of exceptions -- both "Downloads" and "Applications" have really weird numbers for "position of column 1" which bear no relation to what you actually see!

1 Like

Thanks

Thank you, this is fantastic. Where have you been for the past 15 years!? Haha, I didn't know you could call it like that so much better. Sonoma 14.4.1, the Columns double line is gone, but that is back in 14.5, not that I really need that one all that much. Thanks again. This is absolutely wonderful and has been plaguing me for over a decade. Apple locked down apps that worked around this.

Is this now working reliably for you with Downloads and Applications folders?

For what it's worth, Found Image works 100% of the time (for many years now) and is easier to set up. But if your hardcoded way is now working 100% of the time, I would consider switching on the off-chance that the macro is more shareable.

Apple haven't made any OS changes in the last 24 hours so no, it doesn't work with windows open on the Downloads or Applications directories.

You seem to be working in Column view anyway (which I avoid because a) I don't like it, and b) it can really bog down when viewing remote shares) so you'd have to rewrite the AS.