Useful JavaScript AppleScripts I make for batch-altering iTunes track data. Inspired by scripts by Doug Adams
If you import lots of music into your iTunes library and you want your track data to be perfect, don't alter them by hand! Use scripts! A combination of scripts by Doug Adams and my own work really well. If there's a script I haven't made, don't worry, I make scripts all the time!
Feel free to request some new scripts ideas (just create an issue).
Feel free to use and modify yourself! Just keep them free to use.
Be careful - please backup your iTunes library before using
Install node using NVM, and use nvm install -s
to install Node 8.
Then run:
git clone https://github.com/dylan-chong/itunes-applescripts
cd itunes-applescripts
npm install
- Run
npm run gulp -- ls
to see all available script names - Run
npm run gulp -- build-execute -s a-script-name
to build and then execute the script. Run again with--no-dry-run
as an argument to apply side effects
Or alternately:
- Run
npm run gulp -- build
to build all of the scripts into./build/
, or rungulp build -s <the-script-name>
to build a specific script (runnpm run gulp -- ls
to see all available names) - Call
npm run gulp -- execute build/<SCRIPT-NAME-HERE>
to run a specific script
Note: There are plenty of TypeScript warnings because this project was recently moved to TypeScript, but not all scripts have been typed yet.
You can also run npm run gulp -- help
to see the list of tasks and descriptions
The scripts are all disabled in a hard-coded way. In order to get the script to
apply changes to your iTunes library, look for the line of code that // Code that applies the changes:
, uncomment the code below it, and run the script
again. This will be changed in the future, ideally with some sort of GUI.
- Open Safari, then enable
Develop > YourComputerName > Automatically Show Web Inspector for JSContexts
- Then add a
debugger
line somewhere in the program (the debugger won't open until the program reaches this line) - Run the program. Note that sometimes the debugger doesn't open for some reason, in which case just restart Safari.
Run npm run gulp -- watch
then edit a
./src/scripts/<SCRIPT-NAME>/<SCRIPT-NAME>.script.ts
script file using your
favourite text editor / web IDE. Gulp will watch for changes, rebuild the
changed script, and execute it (including when you just write the file
without making any changes).