I have also created a very simply sample project to demonstrate this. It is basically just the template that XCode generates when you set up a new share extension. I have only adjusted the activation rule as shown above.
https://github.com/greimers/sharry-share-extension-sample
Topic:
UI Frameworks
SubTopic:
AppKit
Tags: