Reading currently playing track in macOS using ScriptingBridge not working

。_饼干妹妹 提交于 2019-12-04 19:14:33

The key thing is that you must at some point see the dialog that says

MyApp wants access to control “iTunes“. Allowing control will provide access to documents and data in “iTunes“, and to perform actions within that app.

If you have not seen that dialog:

  • In the Entitlements, turn sandboxing off.

  • In the Info.plist, add a Privacy - AppleEvents Sending Usage Description entry with some arbitrary string as its value.

Run the app. If it still doesn't work, then say this in the Terminal:

tccutil reset AppleEvents

and run the app again.

The solution provided by matt works.

I noticed that the sandboxing feature can still be enabled, if I add the following key to the entitlements file:

    <key>com.apple.security.temporary-exception.apple-events</key>
    <array>
       <string>com.apple.iTunes</string>
    </array>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!