Friday, January 28, 2022

#1 2020-04-25 02:28:36 pm

CamSox
Member
Registered: 2016-12-22
Posts: 13

Not authorized to send Apple events to Music

Hello all,
I'm writing a simple Music controller app using ApplescriptObjC in Xcode but when I click a button to play/pause the music I get "-[AppDelegate playPause:]: Not authorized to send Apple events to Music. (error -1743)". I understand that this is macOS's privacy settings kicking in and that I need to enable the usage description, but the thing is I already put the "Privacy - Media Library Usage Description" in info.plist and it's still not working. Any help would be greatly appreciated.

Here is the handler thats throwing the error, just in case there's something wrong with it.

Applescript:

on playPause_(sender)
tell app "Music" to playpause
end playPause_

Last edited by CamSox (2020-04-25 02:31:57 pm)

Offline

 

#2 2020-04-25 02:47:42 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11763
Website

Re: Not authorized to send Apple events to Music

You have to add the "Privacy - AppleEvents Sending Usage Description" key


regards

Stefan

Offline

 

#3 2020-04-25 02:54:11 pm

CamSox
Member
Registered: 2016-12-22
Posts: 13

Re: Not authorized to send Apple events to Music

Thank you for your response. I added the key but the same error is still occurring.

Offline

 

#4 2020-04-25 09:36:10 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11763
Website

Re: Not authorized to send Apple events to Music

Is Hardened Runtime enabled in Signing & Capabilities? If yes, you have to check also the Apple Events checkbox


regards

Stefan

Offline

 

#5 2020-04-26 11:02:02 am

CamSox
Member
Registered: 2016-12-22
Posts: 13

Re: Not authorized to send Apple events to Music

That worked! Thank you so much for your help.

Offline

 

#6 2021-07-24 06:24:37 am

SunnyFrinton
Member
Registered: 2012-09-13
Posts: 36

Re: Not authorized to send Apple events to Music

Hi
I'm having a similar problem, "Not authorized to send Apple events to Contacts. (error -1743)" when trying to add a new contact to Contacts using ApplescriptObjC project.
Found your original post and solution, have set Hardened Runtime to Yes but don't know where to find Apple Events checkbox, please can you advise me.
Many thanks

Offline

 

#7 2021-07-24 08:26:19 am

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11763
Website

Re: Not authorized to send Apple events to Music

"Privacy - AppleEvents Sending Usage Description" is a key in Info.plist


regards

Stefan

Offline

 

#8 2021-07-24 10:21:01 am

SunnyFrinton
Member
Registered: 2012-09-13
Posts: 36

Re: Not authorized to send Apple events to Music

Thank you for your rapid response, added the Privacy - AppleEvents Sending Usage Description and set Enable Hardened Runtime to Yes but still issues message  "Not authorized to send Apple events to Contacts. (error -1743)".
Is there anything I have to add to the coding in the app?
Thanks in advance.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)