Applescript: Fade iTunes to Selected Track
Ever playing music for other people from iTunes? And want to change the song without everyone noticing? Trying to do a manual fade is tough. This script lets you select the next song you want to play, and then fade the volume out and in to that track. Download: itunes-fade-to-selected-track.zip
property initialVolume : null
tell application "iTunes"
set speed to 5 -- lower means slower fade
if sound volume = 0 then -- if volume is all the way down, fade in
play
set initialVolume to 60
repeat until (sound volume) is greater than or equal to (initialVolume - speed)
set sound volume to (sound volume + speed)
end repeat
set sound volume to initialVolume
else -- fade out, skip to selected track, fade in
set initialVolume to (get sound volume)
repeat until (sound volume - speed) is less than or equal to 0
set sound volume to (sound volume - speed)
end repeat
set sound volume to 0
play selection
repeat until (sound volume + speed) is greater than or equal to initialVolume
set sound volume to (sound volume + speed)
end repeat
end if
end tell
Summit Sunset
Driving over HWY 17 in my Acura CL-S... Stopped to watch the sun set
over the tree-topped mountains.
Applescript to Remove Artist Names from Track Names
I just realized I never posted this online. I did this a couple months ago, and have been using it frequently (because I'm a chronic music pirate).
I occasionally get a bunch of tracks in iTunes that have the Artist Name in the Track Name as well. For example:

...and it's just a pain to go through and remove all the artist names from each track title... the task is a prime candidate for automation.
Usage: Select songs in iTunes (it will skip songs that don't have the artist name in the track name), Run the applescript (I use QuickSilver for this). Result:

So, here's my applescript: (download)
tell application "iTunes"
set these_tracks to the selection
if these_tracks is null then display dialog "No tracks are selected."
repeat with i from 1 to the count of these_tracks
set thisTrack to (item i of these_tracks)
set originalName to the name of thisTrack
set theArtist to the artist of thisTrack
if originalName contains " - " then
if originalName contains theArtist then
set newName to characters ((count of characters of theArtist) + 4) thru end of originalName as string
if (characters 1 thru ((count of characters of theArtist) + 4) of originalName as string) contains theArtist & " - " then set the name of the thisTrack to newName
end if
end if
end repeat
end tell

