FinderSync检查是否选择了扩展名 [英] FinderSync check if extension is selected

查看:175
本文介绍了FinderSync检查是否选择了扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发FinderSync扩展名,在检查选择内容是选择还是选择/取消选择扩展名时遇到一些问题.

I am developing a FinderSync extension and I have some issues in checking if the selection is selecting, or selecting/deselecting the extension.

是否可以通过编程方式检查是否在System Preferences->Extensions中选择了FinderSync扩展名?

Is there a way to programmatically check if a FinderSync extension is selected in System Preferences->Extensions?

此选择更改时,是否有任何API会收到通知?

Are there any API's to get notified when this selection changes?

除了使用以下内容外,是否还有任何API可以选择/取消选择扩展?

Is there any API to select/deselect an extension, beside using the following?

system("pluginkit -e use -i com.mycompany.finderExt")

请注意,我已经访问了以下页面:

Note that I have already visited these pages:

如何启用FinderSync扩展可可中系统偏好设置中的目标-目标C

OSX Finder同步扩展

推荐答案

pluginkit -m -A -i com.mycompany.finderExt

如果启用了分机,呼叫将返回

If the extension is enabled, the call will return

"+ com.mycompany.finderExt(1)"

如果未启用该分机,则呼叫将返回

If the extension is not enabled, the call will return

-com.mycompany.finderExt(1)"

请注意加号和减号,只需解析返回值以确定扩展名是否已启用.

Notice the plus and minus signs, just parse the return to determine if the extension is enabled.

这篇关于FinderSync检查是否选择了扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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