I've had the (mis)fortune to get a new work laptop with the O' so great Touch Bar which I so immensely hate and have changed the Touch Bar to display F-keys.
However one thing I do miss is my global Media Keys. I'm primarily listen to Spotify and I know it has shortcuts but that requires me to make the Spotify window active which it rarely is.

I've looked into both Google and the shortcut options Apple provides me and I have yet to find a way to set up a global shortcut for the Media Keys (Next, Prev. Play/Pause)

Any help or suggestions would be greatly appreciated.


This solution is a bit of a workaround, but I think that it should work for you.

First, you can write some AppleScripts that will perform the actions Next, Prev., and Play/Pause. I found some examples here. If you are on macOS Catalina, you will need to replace "iTunes" with "Music", unless you only use Spotify and don't want to check for other open applications.

Next, you can create a Quick Action (also known as a service) in Automator. I found some instructions to do that here.

For each AppleScript (Next, Prev, Play/Pause), you can either save it as an application, and set the service to open that application, or you can have your service run the AppleScript directly by using the Run AppleScript variable in Automator.

When you save each service, give it a name (like next, prev, and play), as that will be what shows up in the shortcuts menu.

Now that you have 3 services, you can go to System Preferences -> Keyboard -> Shortcuts -> Services. You can now set a keyboard shortcut to run each service, which in turn should run the AppleScript to perform the Media Action you want. The services you just made should be in the General section, which is at the very bottom of the list for me.

  • Hi Beninto, thanks for your reply. It was very helpful and does actually works very well. Now my next challenge is to get those goddamn shortcuts to work but that's a separate issue :-) Thanks again 👍 – Mestika Dec 9 '19 at 7:07
  • @Mestika No problem. What about the shortcuts aren't working? Are you having an issue adding them in System Preferences? – beninato Dec 9 '19 at 8:35
  • Well for some reason the service do not response. The service works when running it manually but not via the shortcut. Both the automator and finder has been added to accessibility privacy.. It's a bit weird – Mestika Dec 9 '19 at 9:15
  • @Mestika I would double check that you have the workflow input set to "no input" and in "any application", and that the shortcut you set doesn't have any conflicts (so maybe test it with something like command+option+control+shift+x). Other than those issues, I don't really know how to help you fix it. – beninato Dec 9 '19 at 9:33
  • @Mestika Do you have the check box selected in System Preferences -> Keyboard -> Shortcuts -> Services for the service you created? – beninato Dec 10 '19 at 19:13

I had a similar problem, using a basic, non-apple, USB keyboard pressing F8 wouldn't pause my music whether or not I checked the "Use F1, F2, etc. keys as standard function keys" option.

I spent a while trying to get Applescripts to control Chrome but it was more complicated than controlling Spotify.

What ended up helping was installing Karabiner-Elements. Without any extra configuration, now pressing F8 works to control media.


Everything in @beninato's answer worked for me. The only thing I had trouble with was that when setting the keyboard shortcut for the services I created, it had to include the command key for the service to be run by the shortcut.

Maybe that was your issue @Mestika?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .