Re: Finder — Resizing the Name Column To-Fit with System Events — Yosemite Version
Re: Finder — Resizing the Name Column To-Fit with System Events — Yosemite Version
- Subject: Re: Finder — Resizing the Name Column To-Fit with System Events — Yosemite Version
- From: Robert Poland <email@hidden>
- Date: Sun, 16 Aug 2015 21:05:54 -0600
- Z-usanet-msgid: XID340THqDF47600X34
Chris,
Since I have a continuing interest in controlling the Finder windows I tried your script.
I saved it to the desktop as an app. Then double clicked on and the Finder window did not appear to do anything.
What am I missing?
> On Aug 16, 2015, at 7:09:PM, Christopher Stone <email@hidden> wrote:
>
> Hey Folks,
>
> As you may remember I only recently upgraded to Yosemite.
>
> A major annoyance of this was my Finder resize-name-column macro breaking due to changes in the window structure.
>
> I thought it was going to be hard to fix, so I left it on the back burner for some while.
>
> Today I got especially annoyed and had some time, so I looked into the fix.
>
> I ended up deciding to use the static-text of the column-header as an anchor, and I thought I was going to have to account for variations caused by the sort-widget (is it there/is it not there).
>
> But then it occurred to me to use column-2 as the anchor-point, and everything fell into place.
>
> The script works on my 10.10.5 system with a window in list-view even if the sidebar is hidden or the toolbar is hidden.
>
> It also works so far in search windows.
>
> I'm using Keyboard Maestro as the doulbe-click-agent, because it's way faster than other solutions I've tried.
>
> Enjoy.
>
> --
> Best Regards,
> Chris
>
> ------------------------------------------------------------
> # Auth: Christopher Stone
> # dCre: 2014/10/05 11:02
> # dMod: 2015/08/16 19:37
> # Appl: Finder & System Events & Keyboard Maestro
> # Task: Expand/Contract Name column to fit
> # Libs: None
> # Osax: None
> # Tags: @Applescript, @Script, @Finder, @System_Events, @Expand, @Name, @Column
> # Test: OSX 10.10.5
> ------------------------------------------------------------
>
> tell application "Finder"
> if current view of front window ≠ list view ¬
> then error "View of front Finder window is not list view!"
> end tell
>
> tell application "System Events"
> set quit delay to 0
>
> tell application "System Events"
> tell application process "Finder"
> tell (first window whose subrole is "AXStandardWindow")
> tell static text 2 of scroll area 1 of splitter group 1 of splitter group 1
> set {x, Y} to position
>
> set x to x - 10
> set Y to Y + 5
>
> end tell
> end tell
>
> end tell
>
> end tell
>
> end tell
>
> setKMVar({varName:"X", varValue:x})
> setKMVar({varName:"Y", varValue:Y})
>
> ------------------------------------------------------------
> --» HANDLERS
> ------------------------------------------------------------
> on setKMVar(varRec) -- Record Format: {varName:"text", varValue:"text"}
> set {varName, varValue} to varRec's {varName, varValue}
> tell application "Keyboard Maestro Engine"
> try
> set value of variable varName to varValue
> on error
> make new variable with properties {name:varName, value:varValue}
> end try
> end tell
> end setKMVar
> ---------------------------------------------------------------
Robert Poland
Fort Collins, CO
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden