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.
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.
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.
----------------------------------------------------------------
# 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
----------------------------------------------------------------
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.
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.
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.
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):
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!).
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!
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.