Automate Daily Updates PC to iTunes
Before Proceeding
JScript, Microsoft's version of javascript programming is required. 'Cuz most likely, your HD structure is not identical to mine. But, what a better excuse to learn JScript? The good news is, it comes with the latest version of Windows XP. There is nothing to purchase.
Audience
Intermediate to Power users.
What is This?
A Windows script to automate sending your MP3, AAC, to iTunes and ready it for synching. With housekeeping (delete old tracks/playlist) to boost.
I have scheduled daily recordings of radio programmes from webcasts (you may have pulled these from the air via something like the RadioShark). The files are vcr'ed during the day and sit on my HD and every night I had to manually add them to iTunes and manually create playlists of that day's recordings. I like to use playlists to represent each programme I want to listen to. The 3 steps are:
1. Scheduled daily recordings and store in HD
2. Add files to iTunes and organize by playlist - delete last week recording.
3. Plug in iPOD and synch.
Most people already have step 1 taken care of, using your favorite tools. This script is about automating step 2. So what all one has to do at the end of the day is to plug in the dang thing and let it do its thing. Fresh stuff to listen to everyday. When S. Jobs gets his act together and puts a bluetooth/WiFi in the iPOD, even step 3 will be automated. That's me, anything that's done repeatedly should be automated.
Eventually most radio programmes one listens to will likely be migrated to podcasts, meanwhile, here's a script that will take care of things. Well, Cartalk is already available in podcast but they want to charge you$.
If you are big time JScript programmer, just download the script. If you are new to this, download the Scripting Docs, which includes reference to the JScript language and iTunes Windows SDK. Finally, download Cool Tools, if you are interested in a collection of useful command line tools I have collected.
Wouldn't be easier to buy a tool to do this?
If you are an iTunes user, probably NO. Third party tools typically aren't flexible enough to do EXACTLY as one wants. And to justify their price, they throw in junks in there to make things more complicated, load more stuff to your HD/memory etc. Plus, this is a simple task, pushing files to iTunes. It's just wrong to spend mega-time$ to do this simple thing. Here's a script that does the job, nothing else is needed. Nothing to install. Place the script in a directory of your path and voila.
OK, so customizing pcTOiTunes exactly as one wishes take a bit of an effort, but it's once-off! and u get exactly what u need.
Can't this be done with Smart Playlists?
Not to my specifications. I want my playlists/track names to be short so there is no iPOD scrolling, and namings to contain useful information at-a-glance.
My HD Organization
To understand this script, so u can customize for your own, understanding how my radio recordings are organized is probably needed.
Fig 1. HD Organization
Shown is the NPR's All Things Considered recordings. Two things (marked red above) are relevant to note here: the ATC folder name and the content of the WEEKDAY.TXT file will be used as playlist names. The script also uses the day-of-week info to clear last week's tracks and playlist from iTunes. My recording application creates the WEEKDAY.TXT file.

Fig 2. My Radios Playlists naming convention
When the script is ran against the information in Fig 1, all tracks under the first playlist "ATC*Mon" found is deleted and the playlist removed. Then the playlist "ATC 3-13 Mon" is added, and all the tracks under the "\ATC\Mar 13 2006" folder is pushed to iTunes.
The Script
There are 3 distinct sections in the script.
Section #1 - Delete last week's tracks and playlist from iTunes.
Section #2 - Add this week's playlist.
Section #3 - Add Tracks to the playlist just created.
So I keep one week worth of listening materials. If that works for u, maybe no change to the script is needed, otherwise you are a java programmer! The script does not delete anything from the PC HD.
The script uses the current folder as anchor to find your files. So my scheduled task that pushes my ATC files to iTunes is set up like this

Run once for every programme u wish to push to iTunes.
A Brief word about Naming Convention
Naming your folders and files consistently is a must if you want to automate the process. The task is made easier because of the limited display real state of iPODs. You just can't go wild and name the objects to your fancy, 'cuz u won't be able to use them once loaded into the iPOD. Here we are not talking about the 100 gig of MP3 you have collected through the years. We are talking about scratch collection of audio files you are most likely to keep for no more than one week or so. Start now to name them consistently then you are on your way to automating the whole process.
The Last Word
Look at it this way, if it takes no effort, then I would be charging u $. And have u tried those sweatshop shareware sprinkled on the Web these days? They don't tell you precisely what they do, and when finally u find something that may do the job, it isn't perfect, and lots of times, they have no batch processing. Able to schedule to run themselves while you are away - ha!
My scripts are for industrial automation. Once configured, it's a butler. Your choice.
If u have come this far, u deserve further documentation. Here's the revision history for pcTOiTunes.