FinderSync检查是否选择了扩展名 [英] FinderSync check if extension is selected
问题描述
我正在开发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
推荐答案
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屋!