onsdag den 12. november 2008

Applescript to import music files to iTunes

I was looking around for a applescript which could import files to the iTunes library but couldn't find anything. Maybe it is just too simple...

Add single file:
set musicfile to POSIX file "/Users/username/Music/Michael_W_Smith/Stand/Come_See.mp3" as alias
tell application "iTunes" to add musicfile

You can also add a directory (recurses into subdirectories):
set musicdir to POSIX file "/Users/username/Music" as alias
tell application "iTunes" to add musicdir

It discovers already added files so it wont create duplicates and it will only take noticable time to import when there are new files to import.

Ingen kommentarer: