Wednesday, December 12, 2018

#1 2018-12-08 01:36:27 pm

akim
Member
Registered: 2010-04-04
Posts: 81

Adjust Finder column width to fit tags

I would like to script Finder's List View columns to set a width that fits the length of text of multiple Finder file tags.
The following script changes the size of the column to a static number, designated as the variable ColumnWidth.

Applescript:

on AdjustColumnWidthTo:ColumnWidth
   tell application "Finder"
       set current view of Finder window 1 to list view
       set width of column id label column of list view options of Finder window 1 to ColumnWidth
   end tell
end AdjustColumnWidthTo:

I would like to have the script configure its own column width based upon the space occupied by the longest set of tags in files listed in that Finder window.

Finder provides a keyboard shortcut, accessed by mousing over the View Options bar at the top of the window. When the mouse cursor overlaps the vertical delimiter, Finder changes its shape from a leftward arrow to a cross. Manually clicking Finder's cursor cross at that position accomplishes the desired task of calling Finder to calculate an appropriate column width to fit the contents of the Tags column.

What are possible methods for applescript to command this Finder Window event?

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)