Current Selection Proxy + Multiple Finder Items = Broken #1243

Closed
ar-rm opened this Issue Nov 26, 2012 · 13 comments

2 participants

@ar-rm

Hi,

Upgraded to b71 (3936) last week and started noticing problems with a trigger that uses the "Current Selection" proxy. This same trigger was fine in b70.

Steps:

  • Trigger: "Current Selection" + Move To... + [blank]
  • Select more than one file in the Finder.
  • Call trigger.

The same happens if you do all of this manually without the Trigger.

Result:

  • QS doesn't open up. If you then try to open it in the standard way it does, but it's totally unstable. Things don't work, the interface (Nostromo) looks wrong, tabbing doesn't work, etc.
  • A normal Quit + Re-Launch QS is required.
  • Console log message below.

Expected:

  • QS window with "Current Selection" + Move to... preloaded and the third pane waiting for you to tell it where to go.

Notes:

  • The trigger is fine if you select just one item in the Finder.
  • You can select multiple items, command-g them into QS and then "Move To..." with no problem.
  • Here's what's added to the Console when it's invoked.
11/26/12 11/26, 6:35:07PM   Quicksilver[423]    HIToolbox: ignoring exception '*** -[NSCFArray initWithObjects:count:]: attempt to insert nil object at objects[0]' that raised inside Carbon event dispatch
(
    0   CoreFoundation                      0x00007fff8416d784 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x00007fff84511f03 objc_exception_throw + 45
    2   CoreFoundation                      0x00007fff841174d7 -[__NSPlaceholderArray initWithObjects:count:] + 407
    3   CoreFoundation                      0x00007fff841238e1 +[NSArray arrayWithObject:] + 49
    4   Core Support                        0x0000000114dd8a89 objc_unretainedPointer + 7539
    5   CoreFoundation                      0x00007fff84114fd0 __CFXNotificationPost + 1008
    6   CoreFoundation                      0x00007fff84101548 _CFXNotificationPostNotification + 200
    7   Foundation                          0x00007fff8525fa36 -[NSNotificationCenter postNotificationName:object:userInfo:] + 101
    8   QSInterface                         0x000000010016893d -[QSSearchObjectView setObjectValue:] + 191
)

OS: 10.6.8

@skurfer
Quicksilver OS X member

I was able to reproduce this with some difficultly. Getting the Current Selection to refer to what's selected is tricky in 10.7+. Stay on 10.6 if the Finder Selection is important to you. :-) http://www.openradar.me/9406282

Anyway, I think it has to do with the way the third pane is populated. The parent folder of the file(s) in the first pane should show up there, but it appears to be nil in this case. We'll look into it.

@skurfer skurfer was assigned Nov 27, 2012
@ar-rm

I was able to reproduce this with some difficultly. Getting the Current Selection to refer to what's selected is tricky in 10.7+.

That's weird.

Stay on 10.6 if the Finder Selection is important to you. :-) http://www.openradar.me/9406282

Oh wow.
Thanks for the heads up.
So "Current Selection" has been broken completely in 10.7+ for a while?

Anyway, I think it has to do with the way the third pane is populated. The parent folder of the file(s) in the first pane should show up there, but it appears to be nil in this case.

So the bug has more to do with the empty third pane in the trigger (and QS trying to figure out what it should be) than with the "Current Selection" object?

We'll look into it.

Thanks.

@skurfer
Quicksilver OS X member

So "Current Selection" has been broken completely in 10.7+ for a while?

Since its release, as far as I know.

"Current Selection" is fine in most contexts. It's only when Finder is the frontmost application (or if you use the "Finder Selection" proxy) that you'll get unpredictable results.

So the bug has more to do with the empty third pane in the trigger (and QS trying to figure out what it should be) than with the "Current Selection" object?

Essentially. It's fixed, in any case.

@ar-rm

Since its release, as far as I know.

Does command-g still work in 10.7+
(I've been using QS forever and I'm not sure what the proper name for that is.)

Essentially. It's fixed, in any case.

Great, thanks!
Do you think it will land in the next build?

@skurfer
Quicksilver OS X member

Does command-g still work in 10.7+

It works for getting the selection, but the selection Finder gives back isn't always correct. Same as the other techniques. Though it does seem to be slightly more reliable for some reason.

Do you think it will land in the next build?

Yes, it should be in the next pre-release for B71.

@ar-rm

It works for getting the selection, but the selection Finder gives back isn't always correct. Same as the other techniques.

Weird.

Though it does seem to be slightly more reliable for some reason.

The Proxy Objects have always been a little precarious for me. Especially "Current Selection" and the ones that could dive into an Applications menus. I just tested with the "Finder Selection" Proxy and, as expected, it doesn't really work either.

Yes, it should be in the next pre-release for B71.

Thanks.

@ar-rm

Getting the Current Selection to refer to what's selected is tricky in 10.7+. Stay on 10.6 if the Finder Selection is important to you. :-) http://www.openradar.me/9406282

I just ran across some blog posts that talk about Keyboard Maestro's ability to grab the currently selected Finder item(s):

"Keyboard Maestro and date in the file name"
"Renaming Files with Keyboard Maestro"

Are these relevant?
Does it look like Keyboard Maestro has found a reliable way to get the current finder selection?

If yes, I could contact the KM dev and see if he has any pointers.

@skurfer
Quicksilver OS X member

Does it look like Keyboard Maestro has found a reliable way to get the current finder selection?

Hard to say. Just because it has a way to get the Finder selection doesn't mean it works. In theory, Quicksilver has that feature too, after all. :-) Someone on 10.7+ who uses the app could maybe do some tests. Know anyone like that?

@ar-rm

Hard to say. Just because it has a way to get the Finder selection doesn't mean it works. In theory, Quicksilver has that feature too, after all. :-)

Good point.
I'll email the KM dev and see what he thinks.

Someone on 10.7+ who uses the app could maybe do some tests. Know anyone like that?

Well, part of me wants to upgrade to 10.8, but another part of me keeps putting it off :-)
For all the things I read I get the feeling that a lot of pro-type users wish they stayed with Snow Leopard.

Have you upgraded?
If yes, do you wish you didn't?

Thanks!

@skurfer
Quicksilver OS X member

Have you upgraded?

Yeah, I usually do on day one.

If yes, do you wish you didn't?

Not really. I don't remember specifics, but I feel like it's generally better.

@skurfer skurfer added a commit that closed this issue Dec 10, 2012
@skurfer skurfer resolve direct object before using it to determine indirects
So individual action providers don't need to test for and resolve proxy objects.

fixes #1243
c2ae2b2
@skurfer skurfer closed this in c2ae2b2 Dec 10, 2012
@ar-rm

I contact the Keyboard Maestro dev.
At first he didn't know about the Finder selection bug, but he tested and confirmed that KM is effected by it too (KM also uses AppleScript to get the current finder selection).

He agreed the fix in the Open Radar report was visually ugly so it'll be added to a future KM build as a hidden preference. He didn't have any other ideas on how to get around it and agreed it's a potentially serious bug.

It's surprising to me that there isn't a non-AppleScript way to get the Finder selection.

So there's that.

I see your patch.

  • So that will fix the bug with QS and the third pane, which means everything should be fine in 10.6.8?
  • But, QS (via the Finder + AppleScript) will be unreliable at grabbing the the current Finder selection in 10.7+?

(Thanks for the ML comments)

@skurfer
Quicksilver OS X member

So that will fix the bug with QS and the third pane, which means everything should be fine in 10.6.8?

Yes. This was actually one of three things we changed as a result of looking into this. Any one of the three should fix it.

But, QS (via the Finder + AppleScript) will be unreliable at grabbing the the current Finder selection in 10.7+?

Looks that way. :-(

@ar-rm

Yes. This was actually one of three things we changed as a result of looking into this. Any one of the three should fix it.

Great, thanks!
I look forward to it being fixed and then breaking it for myself when I upgrade to 10.8 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment