Reputation: 22930
On Snow Leopard the third party services are disabled by default. Is there any way to enable it programmatically? I tried with NSRequiredContext and also by editing pbs.plist programmatically as given in following post How do I automatically activate an item in the OS X Services Menu , NSServices not working but its not working for me.
Upvotes: 0
Views: 346
Reputation: 3601
I had some trouble getting this to work in my application as well. When debugging this try calling NSUpdateDynamicServices()
when your app launches and make sure you are registering a service provider. The problem could be that your service isn't getting registered at all. You can use terminal to see which services are registered with /System/Library/CoreServices/pbs -dump_pboard
Example service:
<key>NSServices</key>
<array>
<dict>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Open with app</string>
</dict>
<key>NSMessage</key>
<string>processService</string>
<key>NSPortName</key>
<string>MyApp</string>
<key>NSRequiredContext</key>
<array>
</array>
<key>NSSendTypes</key>
<array>
<string>NSStringPboardType</string>
<string>NSRTFPBoardType</string>
<string>NSURLPBoardType</string>
</array>
</dict>
</array>
Upvotes: 1