Archive for April 2005


iTunes Folder Sync

You can manipulate iTunes on Windows with Javascript! This was a shock & a relief to me, on Mac OS they have Apple Script but I thought we were SOL on Windows. Anyway this has helped me fix one of the most vexing problems with iTunes: It can’t find new music on your hard drive automatically.

The Problem: iTunes Music Library isn’t as super fly as Winamp’s just yet. With Winamp you can store your music in any way you like, say: full albums in their own folder, singles in their own folders separated by genre. Winamp scans these folders (as many as you want) on startup looking for anything new. New music is automatically added to the Winamp library, not so with iTunes. You have to go in and re-import each folder. So I was looking for a way to make iTunes do this automagically.

The Solution: iTunesFolderSync.js

The script performs the following tasks:

  • Scans all your library and remove any tracks that iTunes cannot find on your hard drive.
  • Collect a list of all the folders you store music in.
  • Import all those folders back into iTunes, catching all the new stuff in the process.
  • Initiate a sync with your iPod if one is attached.
  • Lets you know how many tracks were added and removed from the library.

Folder Sync is great for getting new stuff into iTunes that you have just downloaded, like podcasts. Its also great when you are organising your music, moving/renaming files and you want to sync up the library. You can have the script run after downloading podcasts using iPodder.

Technical Notes:

  • You need the Windows Scripting Host and the .js extension set to be executed using \windows\system32\wscript.exe
  • If you have music in formats that iTunes cannot read you will be asked to convert those tracks, even if they already exist in the library. The best thing to do here is to convert the tracks once and replace the originals with the conversions. This way you won’t get asked twice. You could also by lazy and just press ‘skip’.
  • The iTunes SDK is here for you more intrepid hackers. You don’t need the SDK to run the script though.

Adventurs in Mepis – Day 1

I installed Mepis (pronounced like Memphis) on my second machine last night. I wanted to do a Debian distro because I’ve heard such great things about apt-get. I have messed with several Linux distors before but all were RPM based.

Mepis comes as a live CD, meaning you push it into the machine and it runs Linux. As it turns out this was an extremely useful feature. I was installing on a drive I had previously used to back up some data. The drive had an NTFS partition and I wanted to move some of the data off the disk before I erased it. I was able to use SMB to transfer the files over my network to my windows box. Now this is something new for me, iv heard of Linux reading NTFS partitions but it was always ‘experimental’. Mepis auto mounted the partition and it was a breeze to share out via SMB. Score 1 for Mepis.

I proceeded with the install and weirdness ensued. The partition editor kept quitting or crashing after every operation. I think this had something to do with the auto mounter but I never stopped to figure this out. I set up swap and two reiserfs partitions and finished the install. This was probably the easiest Linux install I have ever seen, aside from editing partitions there are no questions to answer and even that could have been done automatically.

Reboot into my new Linux install and everything works. All hardware got detected even the on-board sound, the PCI NIC & the USB mouse with scroll wheel support working right out the box. Then I noticed that the screen resolution was set to 1024×768 and there did not appear to be any way to change it in the GUI. Off to /etc/X11/XF86config-4 to see what’s the matter. Well the monitor (Hitachi CM812) was detected and had all the correct modeline’s set for every resolution the monitor supports. It was even more correct that Windows which thinks this monitor cant do 1600×1200 @ 85Hz. The display section, however, only had one resolution for all the colour depths; 1024×768. So I mess with this, break it once, make a trip to the shell, reboot several times and finally I’m booting at 1600×1200. Seems some things never get any easier.

The next thing I notice is that fonts just look wrong. In Firefox bold text is being substituted for italics, and the font kerning is way too close. So I discover that Mepis doesn’t ship with descent TrueType fonts, and its not exactly their fault, the fonts aren’t free. So I used SMB to copy all the fonts off my windows box and then told X where to find them. This helped things some but it wasn’t perfect. Firefox would not remember my font preferences when I entered them in the dialog. I made a trip to about:config and set the options there. I also had to set matching options in KDE & Konqueror. Now my Linux box looks almost like my Windows box. The Linux font situation is apparently in flux so I suppose haven’t to wrangle the fonts is understandable.

Stay tuned for day two where I mess with Apache and pimp out my desktop to look like Mac OSX.


It Came From The Net

Not having a particular mandate to get anything major done has let me slip onto the net in search of cool stuff:

  • Podcasting is cool, as is iPodder. I get to hear people like Chris Pirillo, Cory Doctorow, Kevin Rose & Leo Laporte yabber on about stuff I find cool. Even if you don’t have an iPod you can still listen in using your favourite MP3 player. I set up my feeds so they play in the morning, its better than CNN. iPodder support for Winamp as a playback target would be a plus.
  • iPodder is written in Python using wxWidgets which is quite a shock. The look and feel is excellent, the app is snappy and has a reasonable memory footprint (30MB). It even has a tray icon, so the desktop integration is great, much better than the mess of third party libs you need with Java. Python for the desktop, who knew?
  • Digg is cool. Apparently this is a Kevin Rose thing, although that may not be so well known. You can go ‘digg’ stuff and see what others are ‘digging’, can ya digg it?
  • Ruby on Rails looks like its cool. It has Ajax libs built in and I want to do a web project with Ajax. I’m going to spend a day or two messing with this tutorial (found via digg) and see what I can make.