• 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: Is finder brain dead?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is finder brain dead?


  • Subject: Re: Is finder brain dead?
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 08 Dec 2011 14:10:25 -0600

On Dec 08, 2011, at 12:21, Robert Poland wrote:
I have a script that uses the following;

tell application "Finder"
delay 10
set selected_Item to selection
delay 10
display dialog "" & selected_Item
end tell

If I open, for example, the Applications folder and select any item then run the script "selected_Item" is empty. If I run the script again all is well.
______________________________________________________________________

Hey Bob,

Re: Is finder brain dead?

Not quite, but it's buggy.

This is the Lion bug I worked around in the script I sent you a while back.

I posted a very lengthy test to the list when Lion first came out to see if the problem was local to my system only, unfortunately it turned out to be a bug.  A major bug in my opinion that I'm amazed has gone unfixed to date.

This problem is intermittent.  When it happens the Finder appears to lose track of which window is frontmost, and usually the list returned by selection is from the window in back of the front window.

This can cause some very unexpected results if there is a selection in that window...

The only work-around I know of is to force the Finder to refresh its window index by opening and closing a new Finder window.

tell application "Finder"
set lionBugFixWin to make new Finder window
close lionBugFixWin
set sel to selection as alias list
end tell

On my system I'm able to reliably cause the bug to appear by using Cmd-Ctrl-O to open a folder into a new window.  If I do this without my fix then sel will be the folder I just opened rather than the selection in the new window.

Try this:

Open a new folder in the Finder and make a selection - then open another window and close it - then run this script:

set docs to path to documents folder
tell application "Finder"
open docs
set _fldr to select first folder of front window
open _fldr
select items of front window
set sel to selection as alias list
end tell

The selection is not what it should be.

Not thrilling at all.

The funny thing is that this seems to only affect selection.  If you move or resize the front window all goes as expected.

--
Best Regards,
Chris

 _______________________________________________
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: Is finder brain dead?
      • From: Paul Scott <email@hidden>
    • Re: Is finder brain dead?
      • From: Robert Poland <email@hidden>
References: 
 >Is finder brain dead? (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Is finder brain dead?
  • Next by Date: Re: Is finder brain dead?
  • Previous by thread: Re: Is finder brain dead?
  • Next by thread: Re: Is finder brain dead?
  • Index(es):
    • Date
    • Thread