更改键盘语言在SANDBOX中以编程方式输入源(TISSelectInputSource)

时间:2015-03-16 17:01:03

标签: macos sandbox macos-carbon appstore-sandbox

我正在尝试以编程方式更改键盘布局。我在change input source language programmatically OSx找到了解决方案,但它在沙盒应用程序中不起作用。我发现我需要在权利文件中设置一个例外,更确切地说是com.apple.security.temporary-exception.mach-lookup.global-name

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  <plist version="1.0">
    <dict>
      <key>com.apple.security.app-sandbox</key>
      <true/>
      <key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
      <array>
        <string>com.apple.tsm.portname</string>
      </array>
    </dict>
</plist>

当我运行应用程序时,我仍然在控制台中收到错误16.03.15 17:47:48,000 kernel[0]: Sandbox: my_app(3704) deny mach-lookup com.apple.tsm.portname。以下是更改键盘布局的文档,但没有关于沙盒的内容。 https://developer.apple.com/library/mac/documentation/TextFonts/Reference/TextInputSourcesReference/index.html#//apple_ref/c/func/TISSelectInputSource 有什么想法吗?

0 个答案:

没有答案