swift – com.apple.iTunes AEDeterminePermissionToAutomateTarget总是返回-600

swift – com.apple.iTunes AEDeterminePermissionToAutomateTarget总是返回-600,第1张

概述import ScriptingBridgeclass iTunesAccess { static func requestAccess() -> Bool { guard #available(OSX 10.14, *) else { return true } if var addressDesc = NSAp
import ScriptingBrIDgeclass iTunesAccess {    static func requestAccess() -> Bool {        guard #available(OSX 10.14,*) else {            return true        }        if var addressDesc = NSAppleEventDescriptor(bundleIDentifIEr: "com.apple.iTunes").aeDesc?.pointee {            let appleScriptPermission = AEDeterminePermissionToautomateTarget(&addressDesc,typeWildCard,true)            AEdisposeDesc(&addressDesc)            return appleScriptPermission == noErr        }        return false    }}

info.pList中:

<key>NSAppleEventsUsageDescription</key><string>somedescriprtion</string>

iTunes运行但我总是得到-600 osstatus.
我怎么解决它?
iTunes捆绑包ID很好.

/usr/libexec/PListBuddy -c 'Print CFBundleIDentifIEr' /Applications/iTunes.app/Contents/Info.pListcom.apple.iTunes

P.S但是,如果我使用“com.apple.dt.Xcode”捆绑包ID它的工作原理!

P.P.S我发现回购https://github.com/melchor629/iTunes-Scrobbler并建立它.它也有效.

解决方法 好好调用NSAppleEventsUsageDescription键 – 如果你链接到10.14 SDK就需要 – 但如果你的应用是沙箱,你还需要一个合适的Apple事件权利:com.apple.security.scripting-targets如果可以,或者com .apple.security.temporary-exception.apple-events如果必须的话.有关详细信息,请参阅 https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/AppSandboxTemporaryExceptionEntitlements.html,其中包括指定两种权利的方法,但只有一种适用,具体取决于当前的 *** 作系统版本. 总结

以上是内存溢出为你收集整理的swift – com.apple.iTunes AEDeterminePermissionToAutomateTarget总是返回-600全部内容,希望文章能够帮你解决swift – com.apple.iTunes AEDeterminePermissionToAutomateTarget总是返回-600所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1018462.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-23
下一篇2022-05-23

发表评论

登录后才能评论

评论列表(0条)

    保存