Coordinated control of iTunes, Pandora and AirFoil

Posted on
Wed Mar 03, 2010 10:01 am
dougkress offline
Posts: 1
Joined: Mar 03, 2010

Coordinated control of iTunes, Pandora and AirFoil

I've just posted two scripts to control iTunes and Pandora (via PandoraBoy) to the user contribution library (http://www.perceptiveautomation.com/filelib/index.php?id=101.

The goal was to have iTunes and Pandora both be controlled with the same buttons, and simplify the control as much as possible. Additionally, I use AirFoil to control speakers throughout the house, so I have some control code for that configured as well.

Through the course of developing these scripts, I quickly came to the realization that I needed to subscribe to Pandora to have it work correctly, so I wouldn't recommend use with the "free" version.

Control of the three applications can be done independently of one another - you don't need to use Pandora to use iTunes and/or AirFoil. Additionally, you can use AirFoil in conjunction with the iTunes sync / control scripts included with Indigo, ignoring the iTunes control functions (and variables) included with this application.

Posted on
Wed Aug 18, 2010 6:53 pm
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Coordinated control of iTunes, Pandora and AirFoil

Reading your post, can I control the PandoraBoy app with AppleScript and output the audio to an AP express? I have a whole house audio setup with an iTunes input, and wish to add Pandora, possibly as a separate input independent of iTunes, so I could have either source playing at the same time in different zones. Is AirFoil needed to direct the output to the APE in order to bypass itunes?

Posted on
Thu Aug 19, 2010 11:57 pm
AlaskaDave offline
User avatar
Posts: 293
Joined: Oct 16, 2008
Location: Juneau, Alaksa

Re: Coordinated control of iTunes, Pandora and AirFoil

Just what I was looking to do. I've been using PandoraOne with my Pandora account so downloaded PandoraBoy so as to have script access. After downloading and running I see no spot w/in PanbdoraBoy to place my username/pass so as to access my account. Any ideas from those using PandoraBoy and this script?

UPDATE: I found an invisible button that appears to accept log-in but you can not enter your username/password for your Pandora account. I've since downloaded PandoraMan that has a similar interface yet accepts log-in. Can PandoraMan be accessed via. this script with modifications?

Most Recent: Looking at the PandoraMan Website it suggests that you first log-into your Pandora account using Safari followed by starting PandoraMan. This works and when quitting both PandoraMan and Safari and relaunching PandoraMan the settings seem to have stuck.

Posted on
Tue Aug 24, 2010 12:58 pm
AlaskaDave offline
User avatar
Posts: 293
Joined: Oct 16, 2008
Location: Juneau, Alaksa

Re: Coordinated control of iTunes, Pandora and AirFoil

Before I install this script, is anyone using it and having good results? With the issues of getting PandoraMan to work I'm questioning if this is still working as advertised. I'd like to hear how users "us it" and what features they find most useful... anyone?

Posted on
Thu Aug 26, 2010 12:49 am
AlaskaDave offline
User avatar
Posts: 293
Joined: Oct 16, 2008
Location: Juneau, Alaksa

Re: Coordinated control of iTunes, Pandora and AirFoil

Well, I seem to be typing/talking to myself. But yes, I did get it working with minimal effort. One thing I have yet to figure out and not sure if you can is the ability to select a Pandora Playlist as apposed to skipping to the next one. Ideas anyone?

Posted on
Thu Aug 26, 2010 3:21 pm
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Coordinated control of iTunes, Pandora and AirFoil

AlaskaDave,

Have you found that you can send the Pandora to an AP Express and the computer's iTunes output to the computer audio out simultaneously?

It will be good to find out if one can directly select Pandora playlists as well. Would make that great.

Posted on
Thu Aug 26, 2010 3:57 pm
AlaskaDave offline
User avatar
Posts: 293
Joined: Oct 16, 2008
Location: Juneau, Alaksa

Re: Coordinated control of iTunes, Pandora and AirFoil

I have not had success on either front. I noticed that the developer of the applescript placed his email in the header of the script so I will likely email him directory on that. As for multiple sources, I would like to always have the system input available for notifications while playing something else (iTunes, AirFoil...etc). I did notice that AirFoil has several plug-ins. One's called SoundFlower. Not sure what it does exactly, the description stating: The Soundflower Extra, used to power System Audio capture. I will likely leave a message for Rogue Amoeba and see if multiple sources is possible.

Posted on
Wed Sep 29, 2010 9:42 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Coordinated control of iTunes, Pandora and AirFoil

Great script! Works pretty well, but I cannot get nextTrack() to move to the next track on Pandora.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Wed Sep 29, 2010 10:25 am
AlaskaDave offline
User avatar
Posts: 293
Joined: Oct 16, 2008
Location: Juneau, Alaksa

Re: Coordinated control of iTunes, Pandora and AirFoil

Colorado4Wheeler wrote:
Great script! Works pretty well, but I cannot get nextTrack() to move to the next track on Pandora.


I believe next track only works with iTunes. I have not looked a PandoraBoy's AS library, wonder if it's listed in there?

Posted on
Wed Sep 29, 2010 2:23 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Coordinated control of iTunes, Pandora and AirFoil

You actually have it there, called NextPandoraBoyTrack, but it doesn't work. I've done some research and apparently that Applescript command for PB is problematic - some work and some don't.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Tue Nov 09, 2010 8:45 pm
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Coordinated control of iTunes, Pandora and AirFoil

Doug,

Love your script. Got it working with no problems. It's set up to directly select stations by their number in the order so as to not have to skip through, but it would also be an advantage to select a station by its name. Does the Pandoraboy applescript command set have such an command?

Code: Select all
station n : A Pandora Station
elements
       contained by application.
properties
        name (text, r/o) : Name of station
        identifier (text, r/o) : stationId for Station


I tried these variations:
Code: Select all
tell application "PandoraBoy"
      set current station to station 1Bluegrass --as well as
end tell


and

Code: Select all
tell application "PandoraBoy"
      set current station to station name 1Bluegrass
end tell


No luck. What is the right way, if possible?

Posted on
Wed Nov 10, 2010 8:13 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Coordinated control of iTunes, Pandora and AirFoil

Try this (untested):

Code: Select all
tell application "PandoraBoy"
      set current station to station named "1Bluegrass"
end tell

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Nov 10, 2010 8:41 am
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Coordinated control of iTunes, Pandora and AirFoil

Code: Select all
0Nov, 2010 9:37:50 AM
  Error               script error: around characters 51 to 66
  Error               script error: PandoraBoy got an error: Can’t set station "1Bluegrass" to station named "1Bluegrass". (-10006)

10Nov, 2010 9:38:19 AM

Posted on
Wed Nov 10, 2010 10:04 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Coordinated control of iTunes, Pandora and AirFoil

I just tried it with one of my stations and it worked, so I'm not sure what's going on. Try running it from Script Editor first.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Nov 10, 2010 10:39 am
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Coordinated control of iTunes, Pandora and AirFoil

That worked. Thanks!

Who is online

Users browsing this forum: No registered users and 6 guests