Reading currently playing track in macOS using ScriptingBridge not working

前端 未结 2 1890
耶瑟儿~
耶瑟儿~ 2020-12-06 14:59

I am trying to read the currently playing track of iTunes using ScriptingBridge. I found a couple of other threads here but no one seems to be working for me (macOS Mojave a

相关标签:
2条回答
  • 2020-12-06 15:39

    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>
    
    0 讨论(0)
  • 2020-12-06 15:52

    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.

    0 讨论(0)
提交回复
热议问题