Automate iTunes Playlist Change

Hello,

I run a shoutcast station with iTunes and Nicecast. I currently automate the change of playlists daily at 12am. My problem is that I want to also automate a 10-15 sec fade out of the current track playing at 12am before the playlist switches. Therefore, when listening to the station, it creates a smoother transition into the first track of the new playlist. Unfortunately, I can’t get this to work with the recorded mouse movement automation. Can anyone help? I think I need to script the fade out action.

Model: Mac Mini
Browser: Safari 525.13
Operating System: Mac OS X (10.5)

Hi,

try this

property speedValue : 0.5

tell application "iTunes"
	set sv to sound volume
	set x to sv
	repeat while x > 0
		set sound volume to x
		set x to x - speedValue
		delay 0.1
	end repeat
	set sound volume to 0
	
	-- change playlist
	
	set x to speedValue
	repeat while x < sv
		set sound volume to x
		set x to x + speedValue
		delay 0.1
	end repeat
	set sound volume to sv
end tell