Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Choose a folder and iTunes will automatically watch it and all its subfolders. You don't have to drag n drop files into iTunes anymore.

Notifications You must be signed in to change notification settings

rayanmestiri/Legacy-iTunes-Library-Updater-Mac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Legacy-iTunes-Library-Updater-Mac

DISCLAIMER

This app doesn't work for iTunes 12.2 and later.
iTunes dropped the support of the XML file for its library in favor of a binary ITL file.

https://support.apple.com/en-us/HT201610

I would not need the XML file to make this app work if the Apple Script code responsible for watching removed items in watched folders wasn't broken. It works just fine with pure Apple Script when watching for added items in a watched folder but when watching for removed/moved items, it doesn't:

on removing folder items from alias after losing listOfAliasOrText

The variable listOfAliasOrText is always empty. If this worked, I wouldn't need a Python script to read the library and I could update the library with Apple Script native iTunes linking.

If you know how to make it work or have a workaround, don't hesitate to contact me or send a pull request.

Choose a folder and iTunes will automatically watch it and all its subfolders.
You don't have to drag n drop files into iTunes anymore.

Instructions

- Launch the app - Click on "Choose Folder" - The folder you choose will be the one iTunes will watch to update automatically - Wait for the process to complete (I didn't add a loading animation or something).
It can be long if you have a lot of sub-folders. - Once the process is completed, you're good to go. - If you want to change the folder or remove the auto updating, launch the app again.

How it works

An AppleScript adds folder actions recursively.
When files are added, the folder action tells iTunes to add the list of files to its library.
When files are removed or moved, unfortunately, we can't get the list of files, see disclaimer above.
So the workaround is to call a python script that parses the iTunes library XML and checks if the paths matches to an existing file on the system.
It creates an array of missing music names and passes it to an AppleScript as an argument.
The AppleScript tells iTunes to remove each of these files from its library.

Known issue

The script doesn't remove Folder Actions from the folders you remove from your main iTunes directory. The issue is related to the fact that I cannot retrieve the list of folders/files removed with folder actions. I don't have a solution yet.

About

Choose a folder and iTunes will automatically watch it and all its subfolders. You don't have to drag n drop files into iTunes anymore.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published