【问题标题】:Finder Sync Badge Extension HandlingFinder 同步徽章扩展处理
【发布时间】:2015-12-29 14:57:58
【问题描述】:

我正在尝试在优胜美地创建一个 Finder 同步扩展,以在文件和文件夹中显示徽章。

我正在移动,但我不知道当我的包含应用程序终止时如何关闭扩展(从首选项中的扩展列表中删除)。任何帮助表示赞赏。

【问题讨论】:

    标签: objective-c macos


    【解决方案1】:

    试试吧..

    在 Finder 中重新加载目录

    //重新加载Finder(更新文件时将word目录改为文件)

     NSAppleScript * update = [[NSAppleScript alloc] initWithSource:[NSString stringWithFormat:@"tell application \"Finder\" to update POSIX directory \"%@\"",path]];
    
    [update executeAndReturnError:nil];
    

    启用扩展的代码(捆绑 ID)

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

    禁用扩展的代码(捆绑 ID)

    system("pluginkit -e ignore -i com.xyz.finderExt")
    

    【讨论】:

    • 另外,如果您在开发过程中遇到问题,使用$ killall Finder 重新启动finder 会有所帮助。此外,当您从不同位置启动应用程序时(例如,通过 xcode 并稍后通过 /Applications/yourapp 进行测试),可能是注册了多个插件。你可以用pluginkit列出它们,例如:$ pluginkit -v -m -i com.xyz.finderExt,然后删除它们,然后用$ killall -HUP pkd重新加载pkd
    【解决方案2】:

    要从首选项中的扩展列表中删除的代码

    pluginkit -r "/Applications/App-name/Contents/Plugins/extension-name.appex"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-11-12
      • 2014-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-28
      • 1970-01-01
      相关资源
      最近更新 更多