Batch Rename the ILife Video Tutorials

With the release of iLife '09, Apple updated its collection of web-hosted video tutorials covering the five programs in the suite. While these videos are useful and informative, I prefer to keep local copies of each tutorial, so that I can view them whenever I like, on whatever Mac I prefer, without having to visit the Apple Web site and wait for them to download again.

Today's hint explains how to simplify the task of naming these saved tutorials, using a simple Automator workflow. Unfortunately, I wasn't able to figure out a way to ease the downloading task--Apple builds the pages dynamically, and my simple scripting skills weren't good enough to figure out an easy way to download all the videos.

So the first part of this process is manual--and depending on your connection speed, potentially time consuming. Before starting, set up a folder hierarchy in the Finder to hold your downloaded videos. I created a top-level folder named iLife Tutorials. Within that folder, I then created folders for iDVD, iMovie, and the rest of the iLife apps. Then, using Safari (or Firefox, or probably any other browser with QuickTime support), click on one of the videos--I started with the first iPhoto tutorial, Importing Photos from a Digital Camera. Once it's done loading (click the Pause button so you don't have to watch while it loads), Control-click on the video itself and choose Save as QuickTime Movie from the contextual menu.

Leave the filename as your browser specifies it, and set the save location to the relevant folder in your newly-created hierarchy--the iPhoto folder, in this case. It's important that you don't change the filename, as ugly as it may be. We'll use Automator to batch rename these files. For now, bore yourself to tears and repeat this process for as many of the tutorials as you'd like to download. (If you want them all, you'll need about 1GB of drive space, and some amount of free time.)

Once you have the tutorials downloaded, launch Automator and create a blank (Custom, in OS X 10.5 parlance) workflow. We'll use Automator to rename the downloaded files; in case of mistakes, I suggest making a copy of your iLife Tutorials folder before you try these workflows--just in case!

This simple workflow will work on a selection of files in the Finder, and clean up the filenames so they're readable and more easily searched. If you open one of your tutorial folders in the Finder, you'll see that the files are named something like this:

apple-ilife-imovie-add_photos-us-20090106_r640-10cie

The workflow will strip out everything before and after the actual name of the tutorial, and then fix the underscores and capitalization in the remaining title. Note that modifying the filenames in this manner will make it more difficult to determine when Apple has updated a tutorial--because you won't be able to see the date in the filename. As I'm personally less interested in any updated videos than I am in having them available now, this doesn't bother me too much. If desired, the workflow could be easily modified to leave the date intact.

I chose to build one workflow, modify it slightly five times, and then use each variant on the files within each folder. Here's the workflow I built; the Library item is listed on the left, followed by the action on the right (the instructions assume you've set the View -> Arrange Actions By menu to Application, not Category):

When done, the workflow should look (more or less) like my version, as seen in this image. You can save the workflow if you want, but I just used it directly in Automator.

Switch back to the Finder, and select all the files in the folder that matches the name you entered in step three above. Now switch back to Automator and click the Run button. The workflow shouldn't take long to run--it took only a second or so on my Mac Pro--and when done, you'll find that you've not got a nicely-named collection of tutorials in the chosen folder.

Switch back to the workflow and edit the third step to reflect the name of the program whose tutorials you'd like to rename next. Switch back to the Finder, select all those tutorial files, switch back to Automator, and click Run. Repeat until you've renamed all the downloaded tutorials.

I realize this solution is far from ideal, but not having to individually rename every downloaded file is a big timesaver. Using this workflow, it took me about 30 minutes to download and rename all 65 tutorials from Apple's site. Even after downloading, it's worth revisiting Apple's site occasionally to see if the company adds any new tutorials.

Subscribe to the Best of TechHive Newsletter

Comments