Monthly Archives: January 2008

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

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:

artistnameitunes.jpg

…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:

artistnameitunes2.jpg

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

From the top of a Redwood



From the top of a Redwood, originally uploaded by Rex Pechler.

I’m on top of a funky tree in the meadow below the UCSC Music Center…

I took this with the Camera PRO iPhone app, which allows you to take
photos with a self-timer. I clipped my phone to a high branch to get
the shot.

I’m actually not too happy with this self-portrait, but Camera PRO
only let’s you use the self-timer 5 times before forcing you to pay
$20. In fact, I tried to purchase the app, but the purchasing website
is very clumsy on the iPhone. And I’m still waiting for my activation
code.

My Courses for Winter Quarter 2008

I’m taking 3 awesome classes. Music and the WWW, Marketing, and Accessibility.

For Music and the WWW, I’ll be researching Music Discovery on the Internet. Things like Last.fm and Pandora. For the final project, I’ll develop an interactive website, but I have to use original content so I’ll be making some music myself.

My Marketing professor is the craziest and most intense I’ve ever had. He’ll start each lecture with “storytime,” where he tells us about doing business in one of the supposed 178 countries he’s been. Yesterday he talked about dancing with a Chinese drug lord on the top of Victoria Peak in Hong Kong, in the Police Chief’s Mansion with 7 Rolls Royces in the driveway. And he’s promised to take us to the “Promised Land.”

I just had my first Accessibility lecture, where we’ll be learning about disabilities and technologies to overcome them. My professor does research in guidance systems for the visually impaired among other things, but this General Education class is more focused on the social impact of disabilities than the technological. My interest here is Web Accessibility, and how I can take that into consideration when I’m developing websites.

Feel free to contact me if you’d like to know more about the course content.