How to fade out/in in iTunes?

If you are using macOS, you can create a new Service with Automator, add a Run AppleScript action to it, and enter the following script:

set current_application to (path to frontmost application as Unicode text)
tell application "System Events"
    if process "iTunes" exists then
        tell application "iTunes"
            set current_volume to the sound volume
            if (player state is playing) then
                repeat
                    repeat with i from current_volume to 0 by -1
                        set the sound volume to i
                        delay 0.01
                    end repeat
                    pause
                    set the sound volume to current_volume
                    exit repeat
                end repeat
            else
                set the sound volume to 0
                play
                repeat with j from 0 to current_volume by 1
                    set the sound volume to j
                end repeat
            end if
        end tell
        tell application current_application
            activate
        end tell
    end if
end tell

You can assign a keyboard shortcut to it in System Preferences > Keyboard > Keyboard Shortcuts > Services.


For Mac OS X v10.5 or later (Intel 32/64 bits), you can use this script, Im using this for fade out/in music when I pause or play my music, or skipping songs, its great and works fine with the built in crossfade from playback menu.its great for party play list and works just fine with the latest version of itunes (12.1.2) http://www.wildbits.com/accubeatmix/