Applescript that plays a random song from iTunes as a new mail sound

Here is the script for it but you must afterwards add it as a new mail rule as “New Mail” and the rules are Description: “New Mail”, If “any” of the following conditions are met:, “To”, “Contains”, in the text window type your complete email address, Perform the following actions: “AppleScript” then click the choose button bu before you do that, copy and paste the script and save it your desktop:


on run
	set volume 4
	tell application "iTunes"
		set shuffle of user playlist "Music" to true
	end tell
	tell application "iTunes"
		play (next track)
		delay 25.4
		tell application "iTunes" to pause
	end tell
	tell application "System Events"
		set visible of process ("iTunes") to false
	end tell
end run