• 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: Yvan KOENIG <email@hidden>
  • Date: Thu, 02 Mar 2017 21:17:35 +0100


Le 2 mars 2017 à 21:06, Christopher Stone <email@hidden> a écrit :

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



I apologizes Chris but I get an odd behavior.

I ran your late script a first time and got :
display dialog "W = 344
X = 300
Z = 300"

I ran it again and I got again :display dialog "W = 344
X = 300
Z = 300"

My understanding was that at the 2nd run I would have get W = 300.

I add that when I use a tool to measure the column width on the screen I get 344.

Yvan KOENIG running Sierra 10.12.3 in French (VALLAURIS, France) jeudi 2 mars 2017 21:15:15




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

  • Prev by Date: Re: Stupid Finder, or is it me?
  • Next by Date: Re: Stupid Finder, or is it me?
  • Previous by thread: Re: Stupid Finder, or is it me?
  • Next by thread: Re: Stupid Finder, or is it me?
  • Index(es):
    • Date
    • Thread