"sync" itunes between 2 computers

Hi,

I would like to write a script that would sync itunes between two computers, in a way that both computers would have their original music plus the music from the other computer that it did not already have.

Before:

Computer 1 Computer 2
song a song a
song b song c
song d song e

After:

Computer 1 Computer 2
song a song a
song b song b
song c song c
song d song d
song e song e

Is this sort of thing possible, or does something like this already exist?

Thanks,

gecko

If you can figure this out, you should post it to Code Exchange, because I’d really love to be able to do this. I’d want it to go a step further and sync playlists and playlist structure as well.

I finally had some free time to work this out a little and I got to this:

--get the paths to the music
set path_to_music_one to alias "path to itunes music on computer 1"
set path_to_music_two to alias "path to itunes music on computer 2"

--get the depth to compare at
set d to choose from list {"Artist", "Albums", "Songs", "All"} with prompt "At what depth do you want to compare?" without multiple selections allowed

--get the music off of every computer
tell application "Finder"
	if d is equal to "Artist" then
		set music_one to name of every folder of folder path_to_music_one
		set music_two to name of every folder of folder path_to_music_two
	else if d is equal to "Albums" then
		set music_one to name of every folder of every folder of folder path_to_music_one
		set music_two to name of every folder of every folder of folder path_to_music_two
	else if d is equal to "Songs" then
		set music_one to name of every document of every folder of every folder of folder path_to_music_one
		set music_two to name of every document of every folder of every folder of folder path_to_music_two
	else
		set music_one to entire contents of path_to_music_one
		set music_two to entire contents of path_to_music_two
	end if
end tell

--compare the music
set in_one_not_in_two to {}
set in_two_not_in_one to {}
repeat with i in music_two
	if i is not in music_one then set in_two_not_in_one to in_two_not_in_one & i
end repeat

repeat with i in music_one
	if i is not in music_two then set in_one_not_in_two to in_one_not_in_two & i
end repeat


Now, is there a way to add music from one machine’s files into another’s iTunes? Maybe with the add command? But how does this work between two machines?

Thanks,

gecko