At the moment our app doesn't support Services, so we don't register any types 
with  registerServicesMenuSendTypes 
and when our app receives validRequestorForSendType we return nil.

But we do have edit boxes, and they register their support for text types all 
on their own.

We have a shortcut Cmd-Shift-L that conflicts with Safari's "Search with 
Google" service.

The problem we have is that the ServicesMenu is eating the shortcut no matter 
what the user has selected. So if we have our
own data selected in one of our own windows, services menu still steals the 
Cmd-Shift-L shortcut, highlights the menu and does nothing.
In fact in the debugger it complains:

2013-03-20 14:19:41.998 MyAppnameHere[18063:303] Unable to find object to 
handle service <_NSServiceEntry - 0x15960e7d0:
        bundleIdentifier:               com.apple.Safari
        bundlePath:                     /Applications/Safari.app
        executablePath:                 (null)
        defaultTitle:                   Search With %WebSearchProvider@
        localizedTitleWithoutSubstitutions:                     Search With 
%WebSearchProvider@
        defaultKeyboardShortcut:        <NSKeyboardShortcut: 0x1594aee90 (⇧⌘L)>
        keyboardShortcut:               <NSKeyboardShortcut: 0x1594aee90 (⇧⌘L)>
        message:                        searchWithWebSearchProvider
        portName:                       Safari
        sendPasteboardTypes:            [public.utf8-plain-text]
        returnTypes:                    [(null)]
        userData:                       (null)
        languages:                      [(null)]>

If the user opens the services menu in this state, that causes the underlying 
Services Manager(?) code to update which services might be
eligible to fire and from then on our keyboard shortcut action fires.  A 
similar thing happens if you then select some text in an edit box, the
Safari service won't start firing until you open the Services menu again and 
the underlying code refigures which services are eligible.

Clearly this sort of thing needs to happen whenever the "selection" changes 
from one type to another, and we must not be triggering it. 
I thought calling [[NSApp servicesMenu] update] might help, but it doesn't
Any clues would be appreciated…

Thanks,

Dave B
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to