Question

I'm writing a piece of functionality for my chat client that will update the user's status with their currently playing iTunes song, much like Skype and similar other chat clients do. I currently just use ScriptingBridge's methods to get iTunes' current song.

However, I can't seem to figure out if I can somehow register a callback that will get called whenever the currently playing song changes in iTunes. I could obviously just have a continuous fire NSTimer that would fire every, say, 10 seconds and check if iTunes is running, and if so, gets the song info and compares it against the stored info. This is probably not the best way of doing it, but I haven't found any other way to do it.

Thanks if anyone can help me with this. Much appreciated.

Was it helpful?

Solution

It seems as if iTunes actually sends out a distributed notification by the name com.apple.iTunes.playerInfo.

See this post for more info about this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top