Toma
Toma

Reputation: 2945

Getting current info song in macOS Catalina (Music.app)

Now that iTunes has been replaced by Music, how should I get current song's info (title, artist, album, artwork, length, current position etc.)? ScriptingBridge doesn't seem to work for Music.app. Running AppleScript inside the app just throws an error: Not authorized to send Apple events to Music.

Upvotes: 1

Views: 326

Answers (1)

yairhoff
yairhoff

Reputation: 102

What version of Mac OS are you using ?

If you're using 10.14 or above, you should give your application explicit permission to send apple events to Music.app (or any other application).

You can do that from the "Security & Privacy" pane of System Preferences. Choose "Automation" of the left and see if your application is listed but not checked.

There's also the AEDeterminePermissionToAutomateTarget API that allows your application to ask the user for permission

Upvotes: 1

Related Questions