Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zellin

macrumors regular
Original poster
Nov 23, 2003
154
0
Phoenix, AZ
I know you can decide to fill an iPod with however many gigabytes worth of random songs with a smart playlist. However, is there any way to do this so that albums are preserved? i.e, So that there are no albums with missing tracks on my iPod?
 
I know you can decide to fill an iPod with however many gigabytes worth of random songs with a smart playlist. However, is there any way to do this so that albums are preserved? i.e, So that there are no albums with missing tracks on my iPod?
The first of these 4 scripts from Doug's Scripts comes close, although it's default function is to erase your iPod then replace its contents with a selection of random (full) albums. It includes an ambiguous pref panel that may allow you to keep some of your current iPod contents intact.
 
This script will create new playlist and fill it with 5 full albums. You can then sync it your iPod. This is only a rough script. It does what is says, but it can be improved. I'll fix some of its problems later today. If you need this script compiled, let me know.

Code:
tell application "iTunes"
	(*make new playlist with properties {name:"Brian"}
	set a to number of file tracks of library playlist 1	
	duplicate (file tracks of library playlist 1 whose album is "Alibis") to playlist "BriN"*)
	
	make new playlist with properties {name:"Brian"}
	
	set a to number of file tracks of library playlist 1
	set b to ""
	
	set mylist to the album of every track of library playlist 1
	
	set c to {}
	
	repeat with loop_var from 1 to (number of items in mylist)
		if c does not contain (item loop_var of mylist) then
			copy item loop_var of mylist to the end of c
		end if
	end repeat
	
	set d to ""
	
	repeat 5 times
		
		duplicate (file tracks of library playlist 1 whose album is item (random number from 1 to (number of items in c)) of c) to playlist "Brian"
		
	end repeat
	
end tell
 
bbarnhart, thanks for that script example.

I'm going to see if I can figure out how to modify it for a friend who wants his 8GB nano to be filled with 7GB of random albums. :)
 
Let me know if you need anything else. A useful feature would be to add a dialog and ask the user how large of a playlist to create.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.