• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Finder — Resizing the Name Column To-Fit with System Events — Yosemite Version
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finder — Resizing the Name Column To-Fit with System Events — Yosemite Version


  • Subject: Finder — Resizing the Name Column To-Fit with System Events — Yosemite Version
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 16 Aug 2015 20:09:12 -0500

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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Finder — Resizing the Name Column To-Fit with System Events — Yosemite Version
      • From: Robert Poland <email@hidden>
  • Prev by Date: Re: AppleScript for Contacts on 10.10.5?
  • Next by Date: Re: Finder — Resizing the Name Column To-Fit with System Events — Yosemite Version
  • Previous by thread: Re: AppleScript for Contacts on 10.10.5?
  • Next by thread: Re: Finder — Resizing the Name Column To-Fit with System Events — Yosemite Version
  • Index(es):
    • Date
    • Thread