Auto Resize Finder Columns

It drives me nuts always resizing Finder columns, both in List View and Column View. I know you can option click on the column to resize everything to fit, I just wish there was a script or a way to have it always do that by default when I navigate through folders.

I found this script in the “AppleScript 1-2-3” book but it doesn’t seem to show or hide in Mountain Lion and you always have to have set sizes which is close but I would rather have it auto resize like option clicking does. Anyway to do this or work arounds that anyone knows of?

-- script 2.27
tell application "Finder"
	activate
	tell list view options of the front Finder window
		set properties to {calculates folder sizes:false, shows icon preview:false, icon size:large icon, text size:12, uses relative dates:true, sort column:name column}
		
		tell column name column
			set properties to {index:1, sort direction:normal, width:280}
		end tell
		tell column size column
			set properties to {index:2, sort direction:normal, width:72, visible:true}
		end tell
		tell column modification date column
			set properties to {index:3, sort direction:normal, width:120, visible:true}
		end tell
		tell column creation date column
			set properties to {index:4, sort direction:normal, width:120, visible:true}
		end tell
		tell column kind column
			set properties to {index:5, sort direction:normal, width:120, visible:false}
		end tell
		tell column label column
			set properties to {index:6, sort direction:normal, width:72, visible:false}
		end tell
		tell column version column
			set properties to {index:7, sort direction:normal, width:72, visible:false}
		end tell
		tell column comment column
			set properties to {index:8, sort direction:normal, width:240, visible:false}
		end tell
		set sort column to size column
	end tell
	
	tell the front Finder window
		set current view to list view
		set zoomed to false
	end tell
end tell

Browser: Safari 536.25
Operating System: Mac OS X (10.8)

Hello.

I ran the script under Snow Leopard, it doesn’t manage to toggle the visibility of the columns to off, when I chose to show label, version and comment. The size properties for the first columns, seemed to work all right however.

It seems to me that you are not allowed to set the visibility of columns in Snow Leopard.

When I tried to set the options in Finder preferences instead of the front window, Script Debugger crashed.

Edit

I find the basic behaviour understandandable, since you can have just one view related to one folder, If a user has taken some time to make a folder look like he or she wants, he or she might find it annoying if it is destroyed, at least when it comes to the number of columns. ( I have not figured out every way the relegating mechanisms works, with regards to always open in a view, and make default view, if this will work from there-after, or inflict on earlier set window - view options.)

A possible work around, which I won’t pursue! is to create an empty new temporary folder, that doesn’t have a .DS_Store file, and try to set the options on that window for the first time, then set the target of that window to be the target of the former window, and close the former window. Who knows, it might work.

I’ll have to see if I can get that to work thanks for the suggestion and help.

Update: It seems that even a folder with no .DS_Store file will not allow you to choose what columns you can show or hide and the resize works as before according to pixel size rather than fitting in the text.

Also it seems that at least in Mountain Lion columns don’t retain their size with folders in Column View but in List View that is retained.

Hey Skillet,

There are a lot of problems with Finder scripting “ especially scripting appearance.

It should be a total no-brainer to set visible of mod-date column to true, but it doesn’t work. Not anymore.

I think it did back in Tiger, but my memory is fuzzy.

There are a number of things you can do, but the limitations are pretty egregious.

Search Google for these queries, and you’ll find several threads:

“list view options” site:http://macscripter.net/

“list view options” site:http://lists.apple.com/archives/applescript-users 2007…2015

-Chris


MacBookPro6,1 · 2.66 GHz Intel Core i7 · 8GB RAM · OSX 10.10.5

Hey Skillet,

This works on 10.10.5.


------------------------------------------------------------
# Change Finder Window List View Options.
------------------------------------------------------------
set otherFolder to path to favorites folder

tell application "Finder"
	set currentFolder to insertion location as alias
	
	tell front window
		tell its list view options
			set properties to {calculates folder sizes:false, shows icon preview:false, icon size:large icon, text size:12, uses relative dates:true, sort column:name column}
			
			tell column name column
				set properties to {index:1, sort direction:reversed, width:280}
			end tell
		end tell
		
		set its target to otherFolder
		set its target to currentFolder
	end tell
	
end tell
------------------------------------------------------------

The failure to update problem I’m working around by changing and restoring the window target started around Lion and has never been fixed.

-Chris


MacBookPro6,1 · 2.66 GHz Intel Core i7 · 8GB RAM · OSX 10.10.5

That is pretty cool, thanks for sharing. Strange to see when you option drag the columns in the favorites folder to see the other folders I ran the script on all resize with the favorites folder only when I option resized the columns.

I love what Xtra Finder does in resizing this in column or list view but after trying that with recommendation from another forum I have found it will crash my computer within the hour of running it. I sometimes run it anyway in desperation because this resizing thing drives me so crazy.

Anyway thanks for making my daily computer life on the Mac a little closer to fine! :slight_smile: