iTunes: how to display random playlist that's playing?

Hi,
I want to write a script that simply goes to a random playlist and starts playing a track in it. (Rather than just going to a random Library track.) I can do the below, but for some reason, iTunes (4.7) doesn’t show the playlist that’s playing, and there’s no way to find out. How can I make it highlight the playlist in the left column, as if I had hand-selected it?

tell application "iTunes"
	activate
	tell some playlist
		set this_track to some track
		play this_track
	end tell
end tell

Hi,

You need to use the ‘view’ property of the browser window. Something like this:

tell application "iTunes"
	activate
	set rand_pl to some user playlist
	set rand_track to some track of rand_pl
	set browser_window to first browser window
	set view of browser_window to rand_pl
	play rand_track
end tell

It might be better to use the shuffle command, then playing a random track.

gl,