Macos – OSX keyboard shortcuts for iTunes from outside the application

ituneskeyboard shortcutsmacos

I listen to music while I work, and it can be tedious to have to locate iTunes to turn my music on/off, which I have to do often. I want to setup shortcuts so I can start/stop my music no matter what application I'm currently in.

I've seen that OSX lets you create application shortcuts, however they don't seem to be working for me for iTunes. I've tried to create a shortcut named 'Play', which matches the name of the command in the iTunes menu exactly, yet when I use the shortcut I just get a standard warning sound from OSX that you get when you're trying to do something that you cannot do.

EDIT: I have found that I can create a shortcut for the 'Stop' command, just not 'Play'. And the 'Stop' shortcut I've created only works when iTunes is the application in focus. So now I'm even more confused.

Here's my shortcut:
enter image description here

And here's the iTunes menu:
enter image description here

Any ideas as to what I might be doing wrong? Or is there another way to go about this?

Best Answer

If you have an Apple keyboard, F8 (or fn-F8) should start or pause playback. If you don't, you might be able to use KeyRemap4MacBook to remap other key combinations to the special F-keys.

Alfred also has some keywords for controlling iTunes, like play and next. You can assign shortcts to them by creating a workflow:

You could also assign a shortcut to a script like this:

tell application "iTunes"
    if player state is playing then
        pause
    else
        play
    end if
end tell

I use scripts like this to jump forward and backward:

try
    tell application "iTunes"
        set player position to player position + 30
    end tell
end try
Related Question