Where are services that belong to a certain application stored? E.g., Make New Sticky Note or New BBEdit Document With Selection

Where are services that belong to a certain application stored? E.g., Make New Sticky Note or New BBEdit Document With Selection.

They are not in /System/Library/Services nor in ~/Library/Services or in the application bundle.

I have run opensnoop and launched Make New Sticky Note but opensnoop didn't return any relevant file i/o.


Solution 1:

macOS applications such as BBEdit can create their own contextual services from within the application framework and tell the operating system to display those services as appropriate. This is why they don't appear in the system's (or the user's) Services or Quick Actions folders.

Application Bundles

Applications contain files and folders within a bundle or package and the instructions to create/show those contextual services is contained within the bundle. CTRL-click on the application and you'll see a context menu item Show Package Contents. Selecting this option will open the bundle and you can browse its contents. Be extremely careful when mucking about in the application's folders and files as you may inadvertently break it. BBEdit's custom contextual services are created from within its bundle.

The info.plist File

Within every macOS application bundle is a required file called info.plist. Open the copy of the info plist file in BBEdit and have a look at its contents. I would strongly recommend you make a copy of the plist file rather than mess up the original. Within the file, there are several services established that are identified with the key NSMenuItem. These entries create the link between the application and the Services menu within the appropriate context. For example, search for the string "Search Here in BBEdit" and you will find the plist entry for that service. As of BBEdit v14.0.1, there are six such services listed.

This is not unique to BBEdit in any way as any application can create its own services in this way.