iTunes fade in/out
I'm trying to have iTunes fade out of one track, then fade into the next track in a playlist.
The code below fades out the current track, then starts playing the next song, but without fading back in again.
Any help is much appreciated.
Thank you.
tell application "iTunes"
set currentvolume to the sound volume
if (player state is playing) then
repeat
repeat with i from currentvolume to 0 by -2
set the sound volume to i
delay 0.01
end repeat
next track
set the sound volume to currentvolume
exit repeat
end repeat
else
set the sound volume to 0
play
repeat with j from 0 to currentvolume by 2
set the sound volume to j
delay 0.02
end repeat
end if
end tell
PowerBook G4 15", Mac OS X (10.5.8)