Not really a solution for just mac, but the way I use my mac to script is to remote in to my PC via rustDesk. Really handy especially if you have smb shares setup for workflow.
There was a mac ARM64 compatible version codeScripter had awhile ago but it’s deprecated from the newer MPV releases and trying to get a compatible MPV version installed is damn near impossible.
Here is the thread if you’re interested. I tried to get it working a few months ago, so maybe someone has found a solution since then.