From 630fe924919840859f86fe1a38dc1bc59982b9a5 Mon Sep 17 00:00:00 2001 From: melchor629 Date: Sat, 11 Sep 2021 10:28:05 +0200 Subject: [PATCH] fix: app blocked when requesting AE permission --- iTunes Scrobbler/services/MusicService.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iTunes Scrobbler/services/MusicService.swift b/iTunes Scrobbler/services/MusicService.swift index 088cfbc..ac72650 100644 --- a/iTunes Scrobbler/services/MusicService.swift +++ b/iTunes Scrobbler/services/MusicService.swift @@ -94,6 +94,9 @@ end tell private func checkAppleScriptPermission() { if #available(macOS 10.14, *) { if !isRunning { return } + // on macOS 11 it seems it is blocking the AE call, + // but request is still raised when using AE. + if #available(macOS 11, *) { return } //See https://www.felix-schwarz.org/blog/2018/08/new-apple-event-apis-in-macos-mojave let desc = NSAppleEventDescriptor(bundleIdentifier: "com.apple.Music").aeDesc! let status = AEDeterminePermissionToAutomateTarget(desc, 0x61657674, typeWildCard, true)