This script operates on the selected playlist in iTunes. It randomizes the tracks of the playlist, preserving the ordering within contiguous tracks with the same album and grouping. This is very useful in randomizing classical works. For example, if you want to play a group of symphonies in random order, create a playlist containing the symphonies. Make sure that no two symphonies on a single album have the same value for the grouping field. Select the playlist, run the enclosed AppleScript, and the playlist will contain the same symphonies, in random order.
Note that I am not a professional programmer. The AppleScript is slow and not very pretty, but works for me. Enjoy.

