Play Snippets of Each Track in a Playlist

Sample a section of each track in a specified playlist.

Back in my early radio days (in the early 1980s, before CDs!) the DJs and Music Director at the radio station would receive tons of promotional albums from record companies. We never had time to listen to everything. So, typically, we’d sit around and listen to a few seconds of each track on a record to determine whether it fit the sound of the station. This would be referred to as doing a needle drop on the album. Similarly, here’s a hack that allows iTunes to breeze through a playlist of tracks, playing just a few seconds from each track.

The Code

This stay-open applet gets a number from the user to be used as the number of seconds between calls to an idlehandler that executes a next trackcommand, thus playing each track in the selected playlist for the specified number of seconds:

	global needle_drop_interval
	
	on run
	  -- get number of seconds
	  set needle_drop_interval to get_a_number("")

	  -- play first song in the playlist
	  tell application "iTunes"
	    play view of front window
	  end tell
	  return needle_drop_interval
	end run

	-- idle routine is called
	on idle
	  tell application "iTunes" to next track
	  return needle_drop_interval
	end idle

	-- handler to get a number from user
	to get_a_number(addenda)

set myNumber to text returned of (display dialog "" & ¬ addenda & "Play each track for how many seconds?" ...

Get iPod and iTunes Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.