Wednesday, December 21, 2011

Dumbing down iTunes smart playlists

I wanted to make "dumb" copies of a few Smart Playlists in iTunes and have the copies updated periodically. Why I want that is part of a scheme not fully baked, so I won't go into it, but I thought this part was worth documenting.

I've had some experience in the past with AppleScript, and it seemed like it would tear this up. It took some time and research, but I eventually came up with this.

tell application "iTunes"
tell source "Library"
repeat with srcPlaylist in {"5 Best", "Played most", "Abbreviated list", "Good sample"}
set cpyPlaylist to "A copy of '" & srcPlaylist & "'"
delete (every track) of playlist cpyPlaylist
duplicate (every track) of playlist srcPlaylist to playlist cpyPlaylist
end repeat
end tell
end tell

That copies a playlist named "Played most" to another playlist named "A copy of 'Played most'". The copy playlist has to exist already (the script won't create it), and whatever is in it will be deleted every time the script is run. You can run it from the command line by putting it in a file and using "osascript" to execute it.

One hangup I had is that having a quotation mark in an AppleScript string is not supported in a way that I'd like as a programmer of more user-hostile languages. I also tried to use Automator for this, and that went nowhere.

A more advanced script might check whether iTunes is running before blithely tossing commands at it. It might also create playlists that aren't there or take some kind of safety precautions. I doubt that I'll expand my AppleScript knowledge for the sake of those "advanced" features, but I'd be happy to hear from someone else who's done it.

Sunday, September 11, 2011

Magic dog noses.

When I was a boy, I thought dogs could smell a person and know their character. If a dog sniffed a stranger and approved, that was a positive sign that the stranger was trustworthy and honest. If dogs really had this super power, it would solve a lot of societal problems, I expect, but I didn't think about it that hard back then.

I think that an adult told me that a dog likes to smell your hand when he meets you because that's how he knows who his friends are. I took this to mean that dogs know who has good intentions by smell. Now I know that the lesson was that dogs recognize people they know by smell (rather than by sight, like we do). I now know that most dogs have no special insight into a man's soul, and they like everyone they meet. Dogs are faithful that way.

Still today, I hold my hand out to any new dog I meet, and I feel some validation from the fact that dogs approve of me.

Sunday, July 03, 2011

Transformers 3

I liked it more than I thought I would, but one thing really bothered me. A lot of the movie is set in Chicago, so I was excited to see it on that account. It triggers some home town pride, even though Chicago isn't really my home town. Then they go and defile the Lincoln Memorial. It didn't bother me when the whole city was turned into a wasteland, but for the bad guys to disrespect Abraham Lincoln, I thought that was offensive.

Sunday, June 19, 2011

Music collecting now and later.

I've had a little experience with different ways of handling my music collection, and this is a brief comparison.

First, and mostly, I've used iTunes and an iPod (really an iPhone). This, I think, is still the best, but that may be because I'm so used to it. I've put some effort into setting it up to work for me, so it does what I want. I nearly always listen through the mobile device, and I like that information about that listening is synced back to iTunes. I use that metadata to control the contents of a smart playlist that I listen to a lot.

Then I got an Android, which doesn't come with a fat 32G memory like the iPhone, so I gave the Amazon Cloud player a try. It works, but in general my network connectivity isn't good enough to use it consistently. I'm most commonly listening on a moving train, so spotty coverage hurts bad. It also doesn't support ratings and smart playlists. On the plus side, the uploader works well, and I got to live beyond my 8G limit when the network was around.

Then I got a 32G memory chip for the Android, and I started using iSyncr to sync to iTunes. This works well! It updates iTunes with changes to ratings and play data, so it gets updates to my smart playlist just like the iPod. My main complaint is that podcasts are disorganized (or rather, organized into one big playlist). I liked the way the iPod gave me a list of subscriptions with an episode count for each, and I could drill down to listen to what I was in the mood for.

I tried DoubleTwist briefly, but changes to ratings on the phone never made it back to iTunes.

I recently got an invitation to the Google Music beta, and I've given it a brief try. The uploader just shoved up everything from iTunes, so I have podcasts mixed in with my music. Ratings are thumbs up/thumbs down, which I could maybe work around, but I wonder why 3/5 stars became a thumbs down. It's also missing a smart playlist feature, but it's not as bad as the cloud player when the network is bad. The Music player on the Android maintains some local cache, so it can keep playing offline. I haven't played with this feature a lot, but it looks as if I could be as happy with it as with local storage most of the time.

Ultimately, I think the Google Music service is going to be my next home. It makes sense to put music there, access it from anywhere, and stop carrying gigabytes of music around everywhere. If I could have the kind of smart playlist I use every day in iTunes, I'd move to it now and shop for another way to do podcasts.

Sunday, March 20, 2011

Kyle's world famous trail mix

I call it trail mix, but it's really mostly candy. The basic idea is, “everything I can think of that’s peanut and/or chocolate.”

  • peanuts
  • peanut m&m’s
  • milk chocolate m&m’s
  • reese’s pieces
  • chocolate chips
  • double dipped chocolate peanuts
  • mini peanut butter cups

Those last two are the only ones that are remotely hard to find. Dipped peanuts can be found at any bulk candy store. The mini peanut butter cups, I get from Trader Joe’s. At my local Jewel, there are bags of mixed peanut butter and chocolate chips, and I’ve used those sometimes. It’s still good if you leave stuff out.

There are also peanut butter m&m’s. I’ve tossed in butterscotch chocolate chips in the past, just because they look right.

Proportions are highly negotiable. I shoot for about the same amount of everything. I get the big bags of m&m’s, etc., and then a gallon ziplock bag will hold about half a bag of each. Mix by rolling the gallon bag around.

I hope this inspires some of you to provide for the expansion of our work force (and I don’t mean with new hires).

Friday, March 18, 2011

I left my heart in San Francisco.

This homeless guy came up to me on the street, and he said he was hungry, but I didn't have any cash. I didn't want to give him anything I'd need later, so I gave him my heart. He looked at me with pity on his face, but he didn't give the organ back.