There are two ways to have a slideshow in iPhoto. From within an album, you can click the Play button and get a quick slideshow. With this method, you have the option to shuffle the order, and play music -- but you can't "fit" the duration of the slideshow to the music.
The other way is to create a slideshow in the sidebar. Here you have the option of setting the duration of each slide to match that of the music (in my case, I had a 20 minute montage), but there is no way to randomize the order -- you have to drag by hand to set the manual order.
My idea is to title the photos with a random number, then sort by title, thereby randomizing the images. Run this AppleScript in Script Editor to do just that:
tell application "iPhoto"
--tell album "photos"
-- Note: change the album name above to reflect the album
-- whose images you'd like to re-title, then remove the "--"
-- at the beginning of the line. Note that if you leave it
-- as "photos," th...