访问组标识符的 AppleScript 应用程序授权 = "*"



我正在开发一个使用应用程序脚本的Mac应用程序。为了沙盒,需要适当的权利,以便获得将苹果记录事件发送到其他应用程序的权限。我已经为应用程序(例如邮件和Spotify)正确地工作了,该应用程序指定了类似的访问组标识符:

<access-group identifier="com.apple.mail.compose" access="rw"/>
<access-group identifier="com.spotify.playback"/>

但是,其他一些Apple制作的应用程序(例如Xcode)类似地指定其标识符:

<access-group identifier="*"/>

我试图以这样的方式配置我的权利文件:

<key>com.apple.security.scripting-targets</key>
<dict>
    <key>com.apple.dt.Xcode</key>
    <array>
        <string>*</string>
    </array>
</dict>

,但是当执行此操作时,我在控制台中收到此错误消息:

AppleEvents/sandbox: Returning errAEPrivilegeError/-10004 and denying dispatch of event xcod/buld from process '-------'/0x0-0x1a05a04, pid=82514, because it is not entitled to send an AppleEvent to this process.

有人知道如何正确配置这个吗?

实际上我自己找到了答案。在SDEF男子页面中,它说:

"*"的标识符是指元素可通过任何应用程序使用, 没有明确的权利。

这意味着您不必在权利文件中添加标识符,并且无论如何都可以工作。我之所以出错的原因是因为我意外使用了未包含在这些特定访问组中的命令。

最新更新