tags:

views:

331

answers:

3

What is the easiest way to get the information about the last song played in iTunes into a Java program? I have looked at JACOB and iTunes COM but they seem like overkill. If that's the only way to go, could anyone provide a good example next to the first google result? A 'hack' method is acceptable as well!

Thanks!

+1  A: 

iTunes is pretty callable from AppleScript, I'd start there.

Looks like Apple's stuff is deprecated, jasconn looks like it's the way forward.

EDIT - Point taken about the mention of COM, points the finger at Windows rather than a Mac. My suggestion for the super hack approach would be to fire up Process Monitor and see what iTunes writes out and to where when you play a song.

Tom
He mentions COM, so Applescript may not be an option.
Zoredache
He only looked at COM, so Applescript may still be an option
Spoike
A: 

Under Windows you must use COM to talk to iTunes.

There is an iTunes SDK available which provides glue you can use.

Thorbjørn Ravn Andersen
A: 

alternatively you could use lastfm web service. it will have all recently played songs in a xml feed.

u just need to be connected to the internet when u play a song