tags:

views:

302

answers:

3

I'm trying to create an OS X Service. I found Providing System Services in Apple's documentation, however I'm finding it less than clear on what exactly I need to do. I'm currently using an application to register my service (thinking that would be more straight forward - eventually I'd like to create a .service), however even after a logout/login my service still doesn't appear in the list of services in the menu.

Is there some step missing from the linked document that I'm missing? I feel like there is some registration step so that the OS knows about my service (in addition to what is listed in that doc), but I'm not able to find anything.

Thanks in advance. :)

Edit: Here is my NSServices dictionary from my Info.plist file:

    <key>NSServices</key>
<array>
 <dict>
  <key>NSPortName</key>
  <string>POPrlTest</string>
  <key>NSMessage</key>
  <string>shortenUrlService</string>
  <key>NSSendTypes</key>
  <string>NSStringPboardType</string>
  <key>NSReturnTypes</key>
  <string>NSStringPboardType</string>
  <key>NSMenuItem</key>
  <dict>
   <key>default</key>
   <string>Shorten URL</string>
  </dict>
 </dict>
</array>
A: 

You might want to look at some commercial products to help you with this. See this posting on Fun Script.

S.Lott
While that would work, I'd like to do this in Objective-C if possible.
Andy
+2  A: 

Make sure your NSServices dictionary has everything it needs. If you're not sure, please post it so we can tell you.

Peter Hosey
All I've done is call [NSApp setServicesProvider:]. Where can I find the contents of NSServices dictionary?
Andy
It's another of the chapters in the System Services documentation. Read the whole thing: http://developer.apple.com/documentation/Cocoa/Conceptual/SysServicesNo NSServices dictionary = no services.
Peter Hosey
A: 

Make sure you are launching your app first to get the system to see the Service. Make sure you are registering the services handler in your app using - setServicesProvider:

Also, check the Console log as that might give you some useful error info.

mgorbach