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:
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):
Finder: Get Selected Finder Items: This workflow is designed to be run with an active selection in the Finder. This step reads the selection into Automator.
Finder: Rename Finder Items: Set the initial pop-up menu to Replace Text, the Find field to an underscore (_), and press the Space key once in the Replace field. This replaces all underscores in the tutorial’s name with spaces. (Each time you add a Rename Finder Items action, Automator will ask if you want to duplicate the files first. I answer no to this question, as I create the backup before I start.)
Finder: Rename Finder Items: Set the initial pop-up to Replace Text, the Find field to apple-ilife-iphoto-, and leave the Replace field blank. This is the line you need to edit for each app in the suite—replace iphoto with garageband, imovie, etc. as needed.
Finder: Rename Finder Items: Set the initial pop-up menu to Replace Text, the Find field to -us-20090106 r640-10cie, and leave the Replace field blank. Check the filename in the Finder to confirm that the coding is the same on your tutorials as it was on mine—if it’s different, enter that coding instead. Note: One or two of the videos have a different date stamp in their names. I had to rename those files by hand in the Finder.
Finder: Rename Finder Items: Set the initial pop-up menu to Change Case. Set the next pop-up men to Basename Only, and then the final pop-up menu to Title Case. This last step changes the all-lower-case tutorial names into their title case alternatives.
When done, the workflow should look (more or less) like my version, as seen in the image at right (click for a large version). 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.