But what about long songs? I've got some that last 3 minutes, and some concertos that go on for hours. And what about if the same song is looped over and over again? I'm not sure you could reliably address the issue that way - interesting approach though.That is tricky. There is an API of some description which let's you get the name of the song which is currently playing... in theory, you could make a script/program which would monitor what was being played, and if it stayed on the same song for more than X minutes, it would close iTunes...?
I wasn't aware of any APIs that worked that way - but sure, if they do, that's probably your best bet!I'm fairly sure that they tell you how many minutes/seconds you are into the song. If the song position timer-thingie keeps moving, then you could assume that the song is still playing. If it did not increase with time, then you could assume that it was paused