Finder: Resize Name-Column To-Fit

Thanks again to both of you for posting this. So nice to just click Command+2 or 3 and get things to go to the right column and name size.

Here they both are for anyone parusing this forum.
Apple - Finder Macros.kmmacros (48.7 KB)

Grateful for smart people in this world like you guys that share your expertise.

2 Likes

Hello. I'm a longtime Mac user, but never delved into the apple script world. Finder "right sizing" has been something I've been waiting for a long time. Stumbled upon this thread.

I downloaded the kmmacros file, but it won't open in Script editor. Is there a way to convert to apple script? :expressionless:

Download Keyboard Maestro if you don't already have it. Download and double-click the macro to import it into Keyboard Maestro. You can then see the actions in the macro and copy out the AppleScript.

If you've any interest in automating your macro -- and if you are looking into AppleScript you must have! -- you should take a look at KM. It's much easier to use than AS, integrates well with AS (both in running AS scripts and also being scriptable via AS), and lets you do lots of things that are either very difficult or impossible via AS (eg image detection).

There's a free trial of KM

The AppleScript itself won't do you much good. IIRC, "System Events" lost the ability to double-click back in El Capitan. Here's a version of the script anyway, so you can see how to get the coordinates of the column divider that needs double-clicking:

tell application "System Events"
	tell application process "Finder"
		tell window 1
			tell splitter group 1
				tell splitter group 1
					tell scroll area 1
						tell outline 1
							tell column 1
								set thePos to position
								set theSize to size
								set theClick to {((item 1 of thePos) + (item 1 of theSize)), ((item 2 of thePos) + 10)}
								return theClick
							end tell
						end tell
					end tell
				end tell
			end tell
		end tell
	end tell
end tell

...and in the macro those coordinates get returned to KM, which does have the ability to simulate a double-click (and much more besides).

Have I mentioned that there's a free trial? :wink:

Awesome! Thank you so much. I will try this and post results. :+1: