iTunes script skips a playlist

I have a script where I construct two playlists (both playlists contain tracks). I want to play one playlist at volume 60 and the second playlist at volume 40. So, I set the volume and tell iTunes to play playlist one, reset the volume and tell itunes to play playlist 2.

The problem is that playlist one is completely skipped. I am using the following to play the playlist:


tell application "iTunes"
	set sound volume to 60
	play playlist "one"
	set sound volume to 80
	play playlist "two"
end tell

What do I need to change to make sure both playlists are played? Thanks.

Untested, but to judge from the iTunes dictionary:


tell application "iTunes"
	set sound volume to 60
	play playlist "one"
	-- Precautionary delay to ensure the player has started before waiting for it to stop.
	repeat while (player state is stopped)
		delay 1
	end repeat
	-- Wait for the player to stop (ie. to complete playlist "one").
	repeat until (player state is stopped)
		delay 1
	end repeat

	set sound volume to 80
	play playlist "two"
end tell