How do i enable the service menu programmatically

2020-03-06 17:07发布

问题:

As the title tells,please help...

回答1:

You need to include the NSRequiredContext key in each of your services' dictionaries.

The documentation doesn't mention this, but it is required since Mac OS X 10.6; as you've seen, your service will be disabled by default if you don't have it.

You should also call the NSUpdateDynamicServices function on launch, to refresh the user's Services menu without them having to log out and back in.



标签: cocoa service