I'd like to know how to detect if an application is playing music (I guess audio) and pause it while my app does something and then resume it once it's done.
It seems like I should be able to do that with "Now Playing" or "Media Player", but these appear to be iOS libraries and not fleshed out for the Mac (or I am misunderstanding the documentation).
Control Center appears to be unscriptable, while a user can control Media via the Shortcuts app, it seems like a 3rd Party app can't embed and execute a shortcut.