I come from a very musically inclined family. We do everything to music. From the very first second we open our eyes every morning (to groovy iPhone alarms) we work to music, study to music, eat/cook to music. I could go on, but I think you get the picture. Lately I realized that the first thing I do every day at work login to my MacBook, connect my iPhone, open iTunes, and then start playing my work playlist. I started to wonder whether this whole process could be made easier (yes, I’m incredibly lazy), and decided I’d try to automate the entire process.
If you want to just get at the code, and don’t much care about the thought process/learning curve, the code is at the bottom in green. Jump ahead and start coding for your particular needs.