Getting a handle on Pandora

I’m a huge fan of Pandora. – it’s great for finding new music or just chilling out listening to some of my well-crafted stations. However, the fact that I’m completely tied to my browser to enjoy it makes me crazy. In particular, the fact that I can’t control the player without the window being active, as I’m able to do with iTunes (and some clever Quicksilver/Applescript magic). Enter PandoraBoy. It’s a Mac-only application that interfaces with Pandora. The best part is that it’s scriptable.

With a bit of Applescript and a Quicksilver trigger, I can create conditionals to control either PandoraBoy or iTunes, depending on which is open at the current time. Below is my script for Play/Pause – a few modifications and you can make scripts for next track, volume, and rating. Woo!

tell application "System Events" to set iTunesIsRunning to (name of processes) contains "iTunes"
tell application "System Events" to set PandoraBoyIsRunning to (name of processes) contains "PandoraBoy"

if iTunesIsRunning then
    tell application "iTunes"
        if player state is playing then
        end if
    end tell
else if PandoraBoyIsRunning then
    tell application "PandoraBoy"
    end tell
end if