• 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
Re: Stupid Finder, or is it me?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stupid Finder, or is it me?


  • Subject: Re: Stupid Finder, or is it me?
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 02 Mar 2017 14:06:14 -0600

On Mar 02, 2017, at 13:02, Robert Poland <email@hidden> wrote:
The script, when run (the first time) from Script Editor shows the correct Name column width but the second time shows a width of 300. BUT the column width never changes.


Hey Bob,

It's meaningless to set a column width and set it again.

In order to get the window to properly update you have to jump somewhere else and back.

It's horribly kludgy, but it's the only method that has worked reliably since Mavericks (if memory serves).

--
Best Regards,
Chris

-------------------------------------------------------------------------------------
set frontAppPath to (path to frontmost application) as text
-------------------------------------------------------------------------------------
set widthNameColumnMinimum to 200
set widthNameColumn to 300
set tempLocation to path to favorites folder
-------------------------------------------------------------------------------------

tell application "Finder"
    activate

    

    set wdw to window 1

    

    tell wdw
        set winTarget to its target as alias

        

        if current view ≠ list view then
            set current view to list view
            # delay 1
        end if -- current view 

        

        if toolbar visible = true then set toolbar visible to false
        if statusbar visible = true then set statusbar visible to false
        if sidebar width ≠ 0 then set sidebar width to 0

        

        tell list view options of wdw

            

            set W to width of column index 1
            set width of column index 1 to widthNameColumnMinimum
            set width of column index 1 to widthNameColumn
            set width of column index 1 to widthNameColumn
            set x to width of column index 1
            set z to width of column index 1

            

        end tell -- list view options of wdw

        

        ----------------------------------------------------
        # This code MUST be included in the script!
        ----------------------------------------------------
        if winTarget ≠ tempLocation then
            set its target to tempLocation
            set its target to winTarget
        end if
        ----------------------------------------------------

        

    end tell

    

end tell

delay 0.15

-------------------------------------------------------------------------------------
# Keyboard Maestro is better about displaying dialogs, but I still use this method.
-------------------------------------------------------------------------------------
tell application frontAppPath
    display dialog "W = " & W & return & "X = " & x & return & "Z = " & z
end tell
-------------------------------------------------------------------------------------

 _______________________________________________
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: Stupid Finder, or is it me?
      • From: Robert Poland <email@hidden>
    • Re: Stupid Finder, or is it me?
      • From: Yvan KOENIG <email@hidden>
References: 
 >Stupid Finder, or is it me? (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Does a NSURL Have a Valid Target
  • Next by Date: Re: Stupid Finder, or is it me?
  • Previous by thread: Stupid Finder, or is it me?
  • Next by thread: Re: Stupid Finder, or is it me?
  • Index(es):
    • Date
    • Thread