Tuesday, September 21, 2021

#1 2012-12-21 10:05:30 am

Skillet
Member
Registered: 2010-01-11
Posts: 134

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?

Applescript:

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


macOS 10.13.4

Offline

 

#2 2012-12-21 12:09:10 pm

McUsrII
Member
Registered: 2012-11-21
Posts: 3046
Website

Re: Auto Resize Finder Columns

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.

Last edited by McUsrII (2012-12-21 12:20:36 pm)

Offline

 

#3 2012-12-22 02:34:31 pm

Skillet
Member
Registered: 2010-01-11
Posts: 134

Re: Auto Resize Finder Columns

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.

Last edited by Skillet (2012-12-26 03:50:33 pm)


macOS 10.13.4

Offline

 

#4 2015-09-14 05:03:57 pm

ccstone
Member
Registered: 2009-02-07
Posts: 415

Re: Auto Resize Finder Columns

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

Offline

 

#5 2015-09-14 06:10:49 pm

ccstone
Member
Registered: 2009-02-07
Posts: 415

Re: Auto Resize Finder Columns

Hey Skillet,

This works on 10.10.5.

Applescript:


------------------------------------------------------------
# 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

Last edited by ccstone (2015-09-14 06:12:34 pm)

Offline

 

#6 2015-09-15 04:34:11 pm

Skillet
Member
Registered: 2010-01-11
Posts: 134

Re: Auto Resize Finder Columns

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! smile


macOS 10.13.4

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)