Jan 24, 2009
We're back for another round of AppleScript and Party Shuffle. Last month I wrote about adding missing party shuffle features using AppleScript. I noticed that there was one issue with the scripts. If you selected an album that had multiple discs then it would add all the discs to the party shuffle ordered by track number. So for example, you have an album that has two discs with three tracks a piece. Then you would get this:
Disc One Track 1 Disc Two Track 1 Disc One Track 2 Disc Two Track 2 Disc One Track 3 Disc Two Track 3
This is obviously not what we wanted. I spent a little time today updating the scripts so that they behave correctly. Now if you select the same album as our example above this is what you will get:
Disc One Track 1 Disc One Track 2 Disc One Track 3 Disc Two Track 1 Disc Two Track 2 Disc Two Track 3
This of course assumes that you have properly set up the disc number and disc count for your tracks. I'm pretty anal about this kind of stuff, so my library has them all set (even Disc 1 of 1). If the disc count is not set then the script will assume that there is only one disc and won't go through the disc sorting routine. You can get the latest scripts here:
Dec 11, 2008
My name is claytron and I'm a party shuffle addict. There, I said it. In my opinion the iTunes party shuffle feature is pure awesomeness. I have been using it like mad since it was introduced. I'm still amazed when I talk to iTunes users that haven't used it.
My typical modus operandi is to set the party shuffle to a rated smart playlist (3 stars and up or 4 stars and up). Then if i want to add an album in the mix I can select it and 'Play Next in Party Shuffle' or 'Add to Party Shuffle'. This is where AppleScript can come in handy. Doug Adams wrote a nifty little AppleScript that allows you to select a track and add that track's album to the party shuffle! This really comes in handy when my eMusic downloads arrive in iTunes. I can sort my library by 'Date Added' and then select a track from one of the newly imported albums and have it start playing next in the party shuffle. Totally effing awesome.
So herein lies the next issue. Let's say I just downloaded five albums and imported them into iTunes. You would think you could highlight a track from each album and then use the 'Play Next in Party Shuffle' script. But instead it pops up with a selection dialog with all the albums in your library. For me this is completely useless, I have 2000+ albums. So I went ahead and modified the script to add the album for each selected track.
After doing so I emailed Doug about the modifications. As you might guess, he gets a ton of emails with modifications and fixes for all the scripts posted on his site and can't possibly include them all. I also don't think he quite understood the purpose of the modification. But since most of the scripts are licensed under the GPL you can still benefit from my mods!
There are two scripts. The first one is the 'Play Album(s) Next in Party Shuffle' which allows you to select one or more tracks and have each track's album be cued up next in party shuffle. The second script is 'Add Album(s) to Party Shuffle' which does the same thing except it adds the album to the end of the party shuffle. That way you don't have to add an album in the middle of another!
Both of these scripts require that the party shuffle is currently playing. I couldn't find a way around that in AppleScript (but I'm still an AppleScript n00b). The only other item to mention is that I added a property to the top of each script called 'show_party_shuffle'. If this is true then you'll be taken to the party shuffle after adding the tracks. If you don't want to be switched over, you can set it to false.