From: John Joyce Date: 2007-12-03T10:29:18+09:00 Subject: Re: Identifying a volume as being an iPod On Dec 2, 2007, at 4:29 PM, Giles Bowkett wrote: >> For example aif or aiff files. These were some of my suspects. > > Ahhhh. I get it. > >> I don't know how iTunes checks audio files, but you can bet it >> doesn't care much about the file name. >> Oddly enough though, it seems that the file name tweaking occurs >> during the transfer to iPods, a little obfuscation to slow down >> hacking the things. > > That means if you have an id3-tag reader (either command-line or > Ruby), you can process the most common use case entirely in Ruby. > > (I'm averse to learning AppleScript but otherwise interested in this > kind of hacking, so that's very good news in my book.) > > -- > Giles Bowkett After spending some time with AppleScript for a day or two now in my spare time, let me assure you: aversion is good. AppleScript is an old dog and it shows. Limitations galore. There are a lot of powerful little hooks in it, but it's hardly worth the effort to reach the level of using them. Turns out GUI scripting still requires a user to turn on this feature manually. Unless somebody knows what to send to the tool defaults write If somebody already could tell me, I could write that into the Ruby portion as a backtick command in the beginning and in the end clean up to turn it off again (if it wasn't on before). Worst thing is that AppleScript can launch a process but can't get output from that process, not directly anyway. It requires use of intermediary file writing and subsequent reading. I've got enough now to where the only thing I have to figure out is how to leverage Applescript for the GUI scripting of adding files to the library. The concept is simple, but I'm working on the learning the mechanism now.