Scripts to load iTunes library from command line
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Load iTunes Library - TO EDIT.alfredworkflow

Having separated iTunes libraries for different setups (e.g., media center, local music, remote playlists) is a powerful way to organize your media library and share resources among different devices (e.g., iPhone synchronization), but it can be painful. While it is possible to load a different iTunes library by opening iTunes and pressing "Alt" at the same time, this is not optimal. Ideally, we would write a script to pass iTunes the library it should load at launch time (e.g., open /Applications/ --load-library=$LIBRARY_PATH). However, to the best of my knowledge, the iTunes API does not expose this - which I honestly do not understand. Googling for a workaround I could not find a good/complete solution, so I made my own. Here you have the setup and the scripts that implement it.

Full description:

Example uses:

  • Loading NAS iTunes library:

./ NAS ~/Music/iTunes /Volumes/media $USERNAME $PASSWORD $NAS_IP $NAS_DIR

  • Loading local iTunes library:

./ LOCAL ~/Music/iTunes