The documentation on how to implement add-on services is described as:
------------------
Add-On Services
You typically define services when you create your application and advertise them in the
Info.plist
file of the application’s bundle. The Services facility also allows you to advertise services outside of the application bundle, enabling you to create “add-on” services after the fact. This is where the NSUserData
entry becomes truly useful: you can define a single message in your application that performs actions based on the user data provided, such as running the user data string as a UNIX command or treating it as a special argument in addition to the selected data that gets sent through the pasteboard. To define an add-on service, you create a bundle with a .service
extension that contains an Info.plist
file, which in turn contains the add-on service’s NSServices
property. The property uses the application’s NSMessage
and NSPortName
values.------------------
So if you are a standalone Mac app, if you wanted to provide dynamic list of services based on user input, you would create a bundle with an Info.plist entry for the add on services and save it where on the system?
In the documentation (in another section) it says:
------------------
A service can be offered as part of an application, such as Mail, or as a standalone service—one without a user interface that is intended for use only in the Services menu.
- To build an application that offers a service, use the extension
and install it in the.app
folder (or a subfolder).Applications
- To build a standalone service, use the extension
and store it in.service
.Library/Services
In either case, you should install it in one of the four file-system domains—System, Network, Local, and User. (See File-System Domains in File System Overview for details.)
The list of available services on the computer is built each time a user logs in. If your service is installed in an
Applications
directory, you need to log out and log back in before the service becomes available. If it’s installed in a Library/Services
directory, this is not necessary. You can force an update of the list of services without logging out by calling the following function:void NSUpdateDynamicServices(void)
------------------
If i'm sandboxed, can I save "Add-On Services" in my sandbox container's Library/Services folder, or would that not work?