AppleScript

Now we need to get the key press that will be coming from the Bluefruit EZ-Key over Bluetooth connected to an action on your computer. We'll do this through a combination of AppleScript and a program called QuickSilver to bind that script to a key press that works regardless of which program is in focus.

Open AppleScript Editor and paste in the following line into a new document.
tell application "Spotify" to next track
You can test this script by clicking the "Play" icon at the top. If Spotify is already open and playing a song, it should skip to the next song. If it's open but not playing, it will begin playing the next track. If Spotify isn't open, it will open the application.

Save this AppleScript to a location you can find again (your Documents folder is a good location). The file format should be "Script."

Quicksilver

Next, we go to QuickSilver. It's main use is a hyper fast application launcher that puts Spotlight to shame. We'll be using it in this case for it's "Triggers" feature.

If you haven't already, install the latest QuickSilver on your Mac. When ready, you should have a new menu bar item at the top near the right. Click it and choose "Triggers.."
Click the "+" at the bottom of the window and choose "HotKey".

In the box under "Select an item," drag and drop the new AppleScript you wrote into the space. The action will change automatically to "Run an AppleScript." Click "Save."
Now to assign the hot key. Click "None" under Trigger to reveal the Settings pane. Click inside the box next to "Hot Key." The words "Set Keys" should now be pulsing. Select your keystroke you programmed into the EZ-Key. In my case, it was F3.
Close the triggers window. You should now be able to test the operation from your keyboard. Press your chosen hot key. If Spotify is already open and playing a song, it should skip to the next song. If it's open but not playing, it will begin playing the next track. If Spotify isn't open, it will open the application.

If it doesn't work, first check the hot key settings inside QuickSilver's Triggers window.
I have discovered that the hot key will not work if you are controlling another computer via screen sharing. This makes sense since the hot key is being sent to the remote computer. Keep this in mind if the button is being mashed mercifully.

What about Windows?

The project could be translated to Windows given the appropriate software to map a global hot key to an event.

This guide was first published on Mar 16, 2014. It was last updated on Mar 16, 2014.

This page (Configure the Hot Key) was last updated on Apr 05, 2021.

Text editor powered by tinymce.