Re: selection bug in Finder
Re: selection bug in Finder
- Subject: Re: selection bug in Finder
- From: Christopher Stone <email@hidden>
- Date: Thu, 17 Jan 2013 17:04:40 -0600
On Jan 17, 2013, at 11:45, Luther Fuller < email@hidden> wrote: So, I tried using
tell application "SystemUIServer" to activate
and that worked. Which suggested that I try something even simpler. I modified my script to this …
on getSelection() activate tell application "Finder" activate set selList to get selection
And now I always get the correct selection! Thanks for the hint.
______________________________________________________________________
Hey Luther,
Yes. Since you're running an applet it can act in place of the SystemUIServer.
I've tried all manner of methods to get around this gnarly bug.
The only ones to have worked are changing the application context OR opening and closing a new window in the Finder (apparently the latter forces the Finder to update its index of what window is frontmost AND has a selection).
The very strange thing about the latter is that 'target of front window' just works — so it appears that 'selection' has a separate understanding of what window is frontmost.
<shrug>
If you don't want to switch app-contexts then you can open and close a Finder window:
tell application "Finder" set w to make new Finder window close w end tell
I decided this method was too disconcerting (for me), since there's no way to make the window appear off-screen.
-- 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