How to Automatically Generate Application Lists

Mac 5:46 – “And behold, every Mac user shall perform system maintenance on a regular basis so that he may escape the wrath that is the occasional hard drive crash. If a hard drive crasheth and a backup is not available, I the Great Mac, shall laugh at the Mac user who is wailing and crying and gnashing his teeth. I the Great Mac am merciful, but do not have mercy for those who do not heed my commandment: thou shalt backup religiously.”

I suppose that if there really were such thing as a computer bible, the preceding quote might well be the very first verse. Everyone knows that one of the most important things you can do for your Mac (and sanity) is to backup regularly. Some people (myself included) backup everything – using some sort of cloning software such as SuperDuper. Others prefer just to back up their important files and documents to some sort of removable drive or media. However, in addition to performing regular backups, a few of us in the Mac community like to do a little spring cleaning every few months. This spring cleaning I’m referring to usually consists of wiping the hard drive and performing a clean installation of OSX followed by all your favorite applications, documents, music, etc.

There are many people on both sides of the “spring cleaning” fence. Some argue that the design of the Mac and OSX eliminate the need for such drastic steps. However, I believe that no matter how clean a system runs, your system always runs faster after having the slate wiped clean. As you might begin to image, however, this spring cleaning process is not something that takes an hour or two. It involves reinstalling OSX, and finding and installing your favorite applications, documents, music, photos, movies, and even your bookmarks and system settings. This can be quite a daunting task, but there are also a number of preemptive measures you can take to make the process go more smoothly – which is what today’s tip is all about.

One of the hardest things to do when performing a spring cleaning or just restoring a crashed hard drive is to remember everything. And applications, at least for me, are the hardest to remember. The Mac has such a great collection of little programs that you’re bound to forget one or two during the reinstallation process. So to help me remember I have created a little Automator plugin that runs every two weeks and creates a text file containing a list of all my applications. Here’s how I did it:

Step 1: Create Automator Workflow
This is by far the trickiest part… unless you know already how to copy and paste that is. Simply create a new automator workflow and under Library click on the Automator application to see the available actions. Then double-click or drag the action called “Run AppleScript” into the workflow window. Now here’s where the copy and paste skills come into play:

Replace (* Your script goes here *)

With do shell script "ls /Applications >~/Documents/apps.txt"

Step 2: Create Plugin
Now that your workflow is complete, simply click File > Save As Plug-in… to save your workflow as a plug-in. When the Plug-in window pops up, select iCal Alarm as the application you want to create the plug-in for. Unfortunately, there’s no way (that I know of at least) to create scheduled workflows within automator. But, you can use an iCal alarm to work around this shortcoming. After clicking “save” iCal will open and automatically create an event for you with your new plug-in attached. Or, you can always create your own event (which is what I usually do).

Step 3: Create iCal Event
To schedule your workflow to run as often as you want, start by creating an event in iCal. Open the information drawer for the event, and click on “alarm” and choose “open file.” Now you’ll see a few sub-options appear. The first, marked “iCal”, will be populated with the iCal plug-in we just created. If for some reason your plug-in didn’t show up you can always choose “other” and find the file yourself. Now, to finish off your event, change the repeat information to match your habits. Personally, I set my backup event to run on the 1st and 15th of every month – but if you install more programs than I do, you might want to increase the frequency in which the even runs.

So there you have it! Make sure you keep this list up to date so that when that day comes (and it will) that your hard drive crashes or you wish to perform some spring cleaning, you’ll be prepared.


Comments have been disabled for this post