Today I figured out how to integrate Alfred with Spotify using keyboard hotkeys. It is a really simple process but for some reason I couldn’t find any instructions or tutorials online. So, I thought I would share the whole setup process here. You, too, can use hotkeys in Alred to control Spotify in just a couple of short minutes.
You may or may not know this but I love the Alfred app. I was a diehard Quicksilver fan until it went open source and its developer left it went downhill from there. Enter, Alfred. The base version of Alfred is completely free and it is well worth installing. However, if you consider yourself a power user I suggest spending the (very little and totally worthwhile) cash for the Alfred PowerPack. Not only will you be supporting the development of a great and useful Mac utility, you will also unlock lots of incredibly useful features. Honestly, the Alfred PowerPack has more than replaced Quicksilver for me and my keyboard-loving ways.
Now, on to the good stuff…
Get Alfred with PowerPack and Spotify
First, you do need the PowerPack to use this Spotify control setup. Go download Alfred and buy the upgrade if you haven’t already. I prefer to disable my Apple Spotlight shortcut (or change it to something other than CMD-Space) and then tell Alfred to use CMD-Space as the Alfred Hotkey. To do this, just disable (or change) the Spotlight shortcut at the bottom of the screen in Apple System Preference > Spotlight.
Then click the Alfred icon in the menubar, choose Preferences, and change the Alfred hotkey setting.
You also need to have the Spotify app and an account if you don’t already. I’m still using the free version for now, but I am getting closer to convincing myself that it’s worth the investment to pay for Spotify Premium.
Get the Spotify Controls extension
Now that you have Alfred seutp you need to install the Spotify Controls extension by phpfunk. Start by downloading the ZIP file from the Github page. Once downloaded, unzip it and double-click the Alfred Extension file in your Finder window. It should be called something like “Spotify Controls.alfredextension”. If you don’t use Growl you should install the one called “Spotify Controls No Growl.alfredextension” instead… or buy Growl because it’s another very useful Mac utility.
Make sure the extension is saved in your Alfred Preferences under Extensions > AppleScripts > Spotify Controls.
By default, the Spotify Controls extension gives you control by typing commands into an Alfred window such as “spot play” (or “spot p”) to Play or “spot n” for Next. I changed the “Keyword” setting from “spot” to simply “s” to save a little time when typing. If you do this make sure you click the “Save” button at the bottom to re-save the extension. However, I don’t plan on typing anything very often because we are setting up hotkeys, remember?
Setup your hotkeys
At this point you have Alfred setup with the Spotify Controls extension. You can now hit your Alfred hotkey (CMD-Space?) and type in a command to control your Spotify app. Cool, eh? But even cooler are hotkeys. Fire up your Alred Preferences and go to the Hotkeys tab. Click the little “+” (plus) icon at the bottom left of the screen and choose Extensions > AppleScript. (Remember, your Spotify Controls extension is really just an AppleScript.) Click in the box to select your hotkey, select “Spotify Controls” from the Extension drop-down box, and then in the Argument box at the bottom enter a command such as “p” (for Play) or “n” (for Next). You can see a list of commands on the Spotify Controls Github page.
Just click that “+” icon again to create as many new hotkeys as you like each with a different command. I setup four hotkeys using my four arrow keys:
- CTRL-ALT-CMD-Up: Now Playing (now)
- CTRL-ALT-CMD-Left: Previous Track (pr)
- CTRL-ALT-CMD-Right: Next Track (n)
- CTRL-ALT-CMD-Down: Play/Pause Track (p)
Do more with Alfred
Now that you have an awesome Spotify/Alfred setup go on and browse all of the other great Alfred extensions available. Enjoy!