tags:

views:

302

answers:

1

Hi people. I need to add custom element to context menu for all running application. It is posible? Something like: I select text and in context menu i have not only application items, but additional items of my application and this items must will be connected to my app. It must work in all applications.

+3  A: 

Check out the Services Implementation Guide.

Preston
Some caveats: 1. Services only appear in the contextual menu on Mac OS X 10.6 and later (or with ICeCoffEE installed); 2. The user must log out and log in to activate them; 3. The user must check their boxes in the Keyboard pane of System Preferences to activate them. This *is* the solution, but it's not as user-friendly as it could be yet.
Peter Hosey
1. Services only appear in the contextual menu on Mac OS X 10.6 and later (or with ICeCoffEE installed); hm you say what i can do it only on snow leopard? on 10.5 and 10.4 i must use ICeCoffEE? With ICeCoffEE i can do it from my app or user must do something by hands
Sergey Zenchenko
In 10.5 and earlier you can use a contextual menu plugin. These no longer work in 10.6 for security reasons. There is sample code for doing this here: http://developer.apple.com/legacy/mac/library/samplecode/SampleCMPlugIn
Rob Keniger
>"Check out the Services Implementation Guide."I read this document but found only solution for service menu not contextural. Is that true? or am I mistaken?. I need plugin for contextural menu not for service menu.
Sergey Zenchenko
The Services menu acts as a system-wide contextual menu and allows you to expose the functionality of your app for selected text in other apps in the way you described in your original question.
Preston
Sergey: I said services only appear in the contextual menu on Snow Leopard, unless the user has ICeCoffEE installed. As irsk notes, you can write a contextual menu module to support earlier versions of Mac OS X. The Services menu is always contextual (adapts to the selection), but only appears as part of the contextual (right-click) menu on Snow Leopard or with ICeCoffEE.
Peter Hosey
Peter, are you sure users have to explicitly activate Services for the contextual menu? AFAIR you do not have to activate a service if it has the new-style plist entry that makes it context-sensitive. I.e. a service can specify a UTI like public.text, and on Snow Leopard that will put it in the contextual menu if the selected object for which the contextual menu was brought up matches that type.I never had to activate "Toast it" or the "Dropbox" service on 10.6. And I don't think we put anything in Toast to auto-activate.
uliwitness