|Mar 8, 2008, 07:56 AM||#1|
Scripted bulk updates to an iTunes database
What's my best bet for scripted bulk updates to an iTunes database?
I want to do pattern-based manipulations on titles of tracks, so for example I want convert
"Concerto in A major RV 552"
"RV 552: Concerto in A major".
Supposing the actual string manipulation is a solved problem, how do I go about reading and updating the iTunes database? I assume this has to involve AppleScript, but I have no idea how to do this, or even whether it's capable of regular expression matching. I guess I could always shell out to Perl.
Ideally I'd like to manipulate the iTunes database from Perl, Python or Ruby, if that's possible.
Anyway, all suggestions gratefully received.
|Mar 8, 2008, 04:41 PM||#4|
Scripting Bridge isn't that good. Appscript is better designed, more reliable, and works on Panther onwards.
#!/usr/bin/python from appscript import * def changename(name): # do stuff nere return name t = app('iTunes').library_playlists.tracks for name, id in zip(t.name.get(), t.id.get()): newname = changename(name) if newname != name: t.ID(id).name.set(newname)
If Ruby's more your thing, you can use rb-appscript instead (the above code will work with minor modification). For Perl, there's Mac::Glue (included in Leopard).
Learn AppleScript, 3rd edition, Sanderson & Rosenthal:
|Mar 9, 2008, 07:00 AM||#6|
Thanks for prompting me to take a closer look at Doug's AppleScripts. I'm already wondering how I managed without Batch Set Sorting Tags.
Anything you particularly recommend from this collection?
Maybe I just need to learn AppleScript to do the updates I have in mind, which I now think are just setting the Sort Name as a function of track Name. The idea is to be able to define smart playlists to represent the various catalogues of works by classical composers, with the works in catalogue order. For example Deutsch for Schubert, Koechel for Mozart etc. etc.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Any way to re-locate iTunes Library??||peanutismint||Mac Applications and Mac App Store||13||Jul 16, 2011 02:00 PM|
|Show updates for all iTunes account in library?||isaaclimdc||iPhone and iPod touch Apps||1||Feb 11, 2011 06:23 PM|
|Connecting iPhone to an ODBC Database||Mac-1984||iPhone/iPad Programming||0||Aug 18, 2010 03:53 AM|
|Disabled Java Script after updating to IT7 & QT||G-Funk||Mac Applications and Mac App Store||0||Sep 12, 2006 08:00 PM|
All times are GMT -5. The time now is 04:15 AM.