Automation is the king

Mar 02, 2012 18:58

Discovered an applescript for myself. Never had a chance to try and look at it, but finally a problem came my way which was a good candidate for automation.
I have a paranoid structure of music storage on server which doesn't match deployment structure of iTunes. Server is used to stream to computers, but also acts as a share to copy music to iPods. So I need to organize by folders to simplify search.
For years literally I've been copying and renaming stuff by hand after fixing tags and my previous attempts to automate process were unsuccessful.
Now that I did it, I fix tags, select tracks and hit deploy. It asks me the root dir and copies all stuff in the right places! I tested it and its brilliant. :)
Applescript itself is not. Its power is intergation with all mac os apps that provide support for scripting. All of the standard ones do, and many 3rd parties do it as well. But the language itself is weird. It looks like those DSLs that try to mimic natural language. I don't think this thing ever worked for anyone nicely. Fortunately you can still execute ye olde shell commands once you've finished interacting with applications if you can't get a grasp of the syntax. I took a look at the number of itunes scripts and examples available on multitude of websites to assemble my frankenstain.
Script tells itunes to provide track selection, asks for a base directory, reads tags for each track and constructs paths based on them then copies file to a new destination. It also takes compilations and multi disc albums into account.
There are still a number of things you can do like bundling scripts in a package or even adding gui using XCode (progress bar would be nice yeah), but for my task and time box it looked like overkill.
P.S. next time i write something for mac os x i'll include support for scripts.

diy, programming, applescript, mac

Previous post Next post
Up