Creating an OS X Service

I'm trying to create an OS X service. I found System Services in the Apple documentation, however I find it less than clear what exactly I need to do. Currently, I use the application to register my service (thinking that it will be more straightforward - in the end I would like to create a service.), However, even after logging out / logging in, my service still does not appear in the list of services in the menu .

Is there any step in the linked document that I am missing? I feel that there is some kind of registration step, so the OS knows about my service (in addition to what is indicated in this document), but I can not 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> 
+4
source share
3 answers

First, make sure that you run your application so that the system sees the Service. Make sure you register the service handler in your application using - setServicesProvider:

Also, check the console log as this may give you some useful error information.

+1
source

Make sure your NSServices dictionary contains everything you need. If you are not sure, send it so that we can tell you.

+3
source

You might want to take a look at some commercial products that will help you with this. See this post on Fun Script .

0
source

All Articles