如何以编程方式启用服务菜单,用户退出登录,然后在键盘首选项中启用它? [英] How do i enable the service menu programmatically with out the user log out then enable it in the keyboard preferences?

查看:198
本文介绍了如何以编程方式启用服务菜单,用户退出登录,然后在键盘首选项中启用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如标题所示,请帮助...

As the title tells,please help...

推荐答案

您需要在每个服务中包含NSRequiredContext 'dictionaries。

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

文档没有提及,但它是必需的,因为Mac OS X 10.6;

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.

您还应该调用 启动时启用NSUpdateDynamicServices 函数,以刷新用户的服务菜单,而无需注销并重新登录。

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.

这篇关于如何以编程方式启用服务菜单,用户退出登录,然后在键盘首选项中启用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆