info on the NEXT song in iTunes?

i was thinking about how awesome it would be to be able to have info on the next playing itunes song. i was messing around with playlists and song id’s trying to do this, but i couldn’t figure it out.

It’s as simple as this

tell application "iTunes"
	set theIndex to index of current track
	set nextTrack to track (theIndex + 1) of current playlist
	set trackName to name of nextTrack
	display dialog trackName
end tell

Just remember that the index isn’t the same as the database id of the track. It’s the position in the playlist. You’ll have to add in code to check if there is a next track, or you may get an error. I haven’t checked to see what happens at the end of the list.