This is my first post on MacScripter. I’m looking for some “community consultation” on a script that I am thinking of putting together. I have a laptop and desktop Mac (for the first time) and now I maintain two iTunes libraries. I want to selectively sync playlists between these libraries.
That means selecting a playlist, having all of its contents copied to the “other” computer. Whenever the script is run in the future and finds that these playlists differ, it will reconcile the differences (I think that I can imagine a way of doing this using unique IDs in the Comment field for each song). I have already written some of the backbone of the script, to give myself a structure to code around.
There already seem to be some possible solutions out there to the iTunes-library-syncing problem:
¢ just using Home Sharing to copy over the songs that I want, when I want them: doesn’t sync metadata after the initial copy, and requires me to be on the same LAN
¢ iTunes Match: it’s non-free but affordable; does it even do this?
¢ setting each iTunes library to “download new purchases”: most of my music doesn’t come from the iTunes store, and no ongoing metadata syncing
¢ regularly quitting iTunes on each machine and rsync-ing the libraries on the filesystem: syncs the entire library, which is inappropriate since I have a 40GB library and a 64GB SSD on the MacBook
One other consideration: Is it possible that iTunes 11 is a rewrite? If so, will AppleScript-ability be written into the new version?
I’d really like to hear from people on these forums. Is this writing this worth my time? Would anybody have a use for this script if I went ahead and wrote it?
Cheers,
Elliot.
Model: “Generic” OS X machine, MacBook (mid-2010)
AppleScript: 2.2.2
Browser: Safari 536.25
Operating System: Mac OS X (10.8)
Is the “requires me to be in the same lan” a problem? A whole lot of the solution depends on that: LAN or sneaker net?
Even the metadata synching solution will depend on that:
a) Applescript: tell application “iTunes” of remote machine … bla bla
b) Export a playlist to your sneakers…
As far as I know, better than what you can do with a reasonable effort. As I understand it, it really synchs, but I have no experience. But it seems the best solution.
…
For this kind of thing Apple is famous for it’s secrecy. The rumour says Apple employees “disappear” when they talk too much. Rumours…
Not before carefully checking the world reknown dougscripts.com!
Meanwhile, a small script that will make iTunes update it’s metadata from files in the current playlist:
tell application "iTunes"
play
repeat
next track
end repeat
end tell
I should have explained my needs a bit better. I wanted to have my MacBook sync with certain playlists in my desktop, when it is connected to my home Wi-Fi network. I’d have liked it to do this with a minimum of user interaction. Sneaker-net is out!
However, it seems that with iTunes Match, Apple have fulfilled my needs and more. I can’t really justify to myself the idea of spending so much time on a script when I can pay a fairly modest AU$35 and get something better.
But for the record, in case anyone is interested, this was my thinking. The script, when instructed to “sync” two libraries, would find playlists with identical names ending with an asterisk.
If a song was present in one playlist and had never had an ID put in its comments field, then it was a “new” song and the script would try to find a match for it in the library of the playlist lacking the song. If no match was found, then the song would be copied over (SCP wrapped in AppleScript, maybe?). If a song with and ID was in one playlist but not the other, then it must have been deleted from the playlist where it was missing.
I would probably have encountered some big problems along the way. It might have been interesting, though.
I agree that there are some excellent scripts to be found there! In fact, that is where this idea came from:
What does this do to the metadata?
I just put the finishing touches on a script that maintains a complex web of directories and symlinks which make my NAS box’s downloads folder comprehensible to (say) XBMC. Anyone interested?
Forces the updating of metadata in tags changed outside of iTunes (or by another iTunes)
Things like star rating don’t work because they are not kept in tags in the file, but do work work with iTunes Match. (I think)
iTunes has a persistent ID and Modification date properties that would make life easier, and an export as plist (though not accessible to AppleScript) that would make your life easier and independent on comments and conventions like asterisks.
Another little piece of scripting that seems helpful for your problem (Match or no Match):
property remoteitunes : "eppc://user:password@xpto.lan"
tell application "iTunes"
play
stop
set di to current playlist
set lcopylist to location of every track of di
set di to name of di
end tell
using terms from application "iTunes"
tell application "iTunes" of machine remoteitunes
set p to make new playlist with properties {name:di}
set view of browser window 1 to p
add lcopylist to p
end tell
end using terms from