Hi,
I've been trying to get NSServices working for my application recently with no success. I have set it up according to the documentation but it does not appear in the services menu ( however it does appear in the keyboard shortcuts section of the System Preferences as a service menu item) Anyway I set the service in my app controller like this:
[NSApp setServicesProvider:self];
The method exposed is:
- (void) addDownloadService:(NSPasteboard *)pboard
userData:(NSString *)userData error:(NSString **)error
My Info.plist then looks like this:
<key>NSServices</key>
<array>
<dict>
<key>NSReturnTypes</key>
<array>
<string></string>
</array>
<key>NSKeyEquivalent</key>
<dict>
<key>English</key>
<string>S</string>
<key>Key equivalent (with command and shift)</key>
<string>S</string>
</dict>
<key>NSSendTypes</key>
<array>
<string>NSStringPboardType</string>
<string>NSURLPboardType</string>
<string>NSRTFPboardType</string>
</array>
<key>NSPortName</key>
<string>MyApp</string>
<key>NSMessage</key>
<string>addDownloadService</string>
<key>NSMenuItem</key>
<dict>
<key>English</key>
<string>MyNewService</string>
<key>default</key>
<string> MyNewService </string>
</dict>
</dict>
</array>
I tried running the debug command with textedit like so: /Applications/TextEdit.app/Contents/MacOS/TextEdit -NSDebugServices com.companyname.MyApp
which outputs the following: MyNewService (com.companyname.MyApp) is disabled in the services menu and disabled in the context menu, by the standard Services policy.
Anyone any ideas why it might not be working?
Thanks Colin