Normally, when I press the button on my 3.5mm headphones, the Music app would pop up and start playing music. When a song was playing, I could pause it by clicking this button. However, since a recent reboot, this doesn't work anymore. The prev, next and pause buttons on the keyboard (f7, f8, and f9) also don't work anymore although they used to work. It is not because of the update to Catalina, because it has worked in Catalina before. Playing and pausing music on Youtube using this button still works.
Is this an update of the Music app (that replaced iTunes)? Is it some setting? Is there any way I can get it to work again? I really like being able to start the music without having to open the Music app and start a track.
To clarify:
- Even if the Music app is active, it does not work
- Both headphone button and keyboard buttons don't work anymore, although they used to work
Best Answer
Here's an imperfect potential solution (depends on how you want to use the feature) – see problem 3 below.
I created an applescript that uses keystrokes to tell apple music to play/pause. This way, you can just use automator to trigger it based on shortcuts (you can similarly bind fast forward and rewind).
Script is below:
Pop this into an automator workflow using the "Run AppleScript" action and you can create a shortcut. I'm having issues doing this now, but it's something you can probably research. I use keyboard maestro, which makes setting up shortcuts significantly easier.
To change to rewind and fast forward, just change the line
key code 49
tokey code 123
andkey code 124
respectively (this is left and right arrow keys)There are a few problems:
key code 48 using {command down}
withset visible of process "Music" to false
and it'll hide the progam