Getting a handle on Pandora

• Bill Hunt

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!

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

<br /> if iTunesIsRunning then<br /> &nbsp;&nbsp;&nbsp;&nbsp;tell application "iTunes"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if player state is playing then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pause<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;play<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<br /> &nbsp;&nbsp;&nbsp;&nbsp;end tell<br /> else if PandoraBoyIsRunning then<br /> &nbsp;&nbsp;&nbsp;&nbsp;tell application "PandoraBoy"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;playpause<br /> &nbsp;&nbsp;&nbsp;&nbsp;end tell<br /> end if<br />