THESE FORUMS NOW CLOSED (read only)

Fun Stuff => BAND => Topic started by: Akima on 01 Feb 2010, 17:26

Title: iTunes and Applescript
Post by: Akima on 01 Feb 2010, 17:26
I hope I'm not posting something everyone already knows (a forum search suggests not), but I've just discovered scripting to automate tasks in iTunes. I'm experimenting with my own scripts, but there are heaps of pre-written scripts available to do many routine tasks here:

http://dougscripts.com/itunes/
Title: Re: iTunes and Applescript
Post by: Tom on 01 Feb 2010, 18:42
For those of us who aren't technologically-inclined, care to explain?
Title: Re: iTunes and Applescript
Post by: Akima on 01 Feb 2010, 19:34
Every Apple computer (or at least copy of OS/X) comes with a built-in programming language called Applescript. So called "scripting languages" are a feature of many operating systems, and intended to automate routine system tasks. In Microsoft-world, they are traditionally called "batch files". Typically, things that a computer user can do manually, such as copying, moving, renaming files etc. can be automated with scripts.

In an iTunes context, Applescript can be used to automate many "music collection management" tasks. For example, when I download music as .wav files from Magnatune and import them into iTunes, each track is typically given a name that includes track number, track title, and artist name, something like this:

01-Some Track Title-Some Band Name

Classical tracks can be more complex, including BWV numbers (http://en.wikipedia.org/wiki/BWV) for J.S.Bach, for example. In the absence of a script, one would have to select the track or tracks in iTunes, press ⌘I to display the track info, and edit the fields manually to put the track number, band name etc. in the correct fields, before removing the surplus info from the track name. This is not a big deal for one, or even a few tracks, but Trevor Pinnock's Les Cyclopes, for example, has twenty-two tracks. Suitable scripts can automate the whole procedure, parsing the track name, extracting the relevant parts and writing them to the correct fields, cleaning up the track name, and so on. Select all the tracks in an album, run the scripts, and you're done.

Disclaimer: I work in the computer industry, so what seems cool and easy to me could appear arcane and pointless to muggles, but I hope this explains a bit better.
Title: Re: iTunes and Applescript
Post by: Dimmukane on 01 Feb 2010, 20:01
It may be arcane, but it's certainly not pointless.  Doing all that stuff by hand is a pain.  Do you know if there is a Windows alternative for this?
Title: Re: iTunes and Applescript
Post by: Akima on 01 Feb 2010, 21:18
It's been a long time since I worked with Windows (and I'm finally out of therapy :laugh:), but Apple Developer Connection offers an iTunes For Windows COM SDK (https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20139)* so it must be possible to do something. A little google-fu reveals these links (http://dougscripts.com/itunes/itinfo/windowshelp.php), for example. You might have a look, but I can't test, recommend, or support any of it. You're on your own, pilgrim!

* Now you guys know what it's like for me when you talk about guitars, pedals and amps....  :laugh:
Title: Re: iTunes and Applescript
Post by: Inlander on 01 Feb 2010, 21:30
God don't mention that you'll just get them started again.

P.S. who is that in your av?
Title: Re: iTunes and Applescript
Post by: Be My Head on 01 Feb 2010, 21:46
Before anyone gets into an argument about Operating Systems; I just want to say I use Arch Linux (http://www.archlinux.org/), so I beat you all in nerd points. Unless someone here uses Gentoo.
Title: Re: iTunes and Applescript
Post by: JD on 01 Feb 2010, 22:21
I use my mind
Title: Re: iTunes and Applescript
Post by: Tom on 01 Feb 2010, 23:06
Thx Akima (got an actual name I can use?), things like these I need explained in English. This is somewhat interesting to me as I will be getting a shiny new macbook pro in the mail soon.
Title: Re: iTunes and Applescript
Post by: Akima on 02 Feb 2010, 01:01
P.S. who is that in your av?
No idea. I clipped the avatar from a drawing I found on Deviant Art titled something like "Guess Who?". I think it might have been intended to be 章子怡 (Zhang Ziyi), but I'm not sure. Edit: I've changed my avatar since I posted this.

Thx Akima (got an actual name I can use?), things like these I need explained in English. This is somewhat interesting to me as I will be getting a shiny new macbook pro in the mail soon.
Akima is a name! :-D  Enjoy your MacBook Pro. It's a nice piece of kit.

Before anyone gets into an argument about Operating Systems; I just want to say I use Arch Linux (http://www.archlinux.org/), so I beat you all in nerd points. Unless someone here uses Gentoo.
Ugh! I wrestle with Solaris and several flavours/descendants of BSD Unix for a living. I do not want to come home to Linux. Besides, I recompiled my home Unix apps on Darwin so I could run them on my iMac and shut down my old SPARCstation 20* home box. Nerdy enough for ya? :-P

* Bought used on e-Bay; I'm not that old...
Title: Re: iTunes and Applescript
Post by: Be My Head on 02 Feb 2010, 07:21
Ugh! I wrestle with Solaris and several flavours/descendants of BSD Unix for a living. I do not want to come home to Linux. Besides, I recompiled my home Unix apps on Darwin so I could run them on my iMac and shut down my old SPARCstation 20* home box. Nerdy enough for ya? :-P

* Bought used on e-Bay; I'm not that old...

*shrugs*, I can't see why anyone would choose to use an Apple product over all of the other *nix OS' if they have the knowledge of how to use one. However I've never owned an Apple product. Is it possible to install a third party window manager on any of their products? Or customize everything right down to the kernel? That's why I love Arch so much. Customization. You get a shell (literally) and build it from there.

/thread de-rail