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.


Domenico Bettinelli

I’m curious why the Automator action is “Run Applescript” instead of “Run Shell Script”. Works just as well without having to throw in the extra Applescript wrapper. Unless I’m missing something.


If you dont want to overwrite the apps list every time its run (maybe you want a history of your installed apps incase something gets lost) then use this:

> ~/Documents/app_list.txt_$(date +%d%m%y)

This will give you a filename like:

app_list.txt_071206 which will only get overwritten if you run it more than once on the same day.

Michael Clark

Another thing to keep in mind is if you have any Applications under your home folder (~/Applications/ ) you need to maintain that listing as well. When I am trying out a program, I install it under my home folder’s App folder until I am pretty sure I will be using the app regularly.


Although I didn’t submit the idea, this was my ideal “dream app” but it would need to be able to extract the registration codes for each application as well as just listing it. Finding the assorted bundles, plug-ins and menu-extras has also been important to me when performing a clean install. An application list is nice, but it is only a start.

Richard Neal

Hm, I don’t know if this is possible with Automator or Terminal, but what if you used something like DownloadComment ( beforehand to put the download URL of all your apps in their comments, and then could extract that and put it in the text file as well? That’d sure make it a lot easier to redownloaded them all.

Stephen Roberts

I too use subdirectories to group applications so needed a way to dig through them more politely than ‘ls -R’.

Ugly, but it works:

do shell script “find /Applications > ~/Documents/full_app_list.txt”
do shell script “grep -h ‘app$’ ~/Documents/full_app_list.txt > ~/Documents/app_list.txt”
do shell script “rm ~/Documents/full_app_list.txt”

It creates a full ‘ls -R’ listing, greps it for applications (*.app) to build an application list, then deletes the full list. (tho I ended up leaving the full list in place too, just as a backup).

Seems to work since apps seem to always have the *.app tags.

Marc D.

This is just like the hint I submittd to last week. I run mine at startup, though some of the commenters offered advice for adding it to the cron jobs which makes it far more automated.

Even though it isn’t recursive, as long as the folder name is the same/similar as the application it’s good enough for me since I can use that to find it on macupdate or versiontracker.

Michael Clark

Replace the ls command with this:

find -f /Applications/ | grep -v “/Contents” | grep .app$

and you’ll get a listing of Folder’s applications as well.

David Appleyard

The command:

ls -R

Does the same thing recursively, but that means it goes into every package and shows all the details about it, contents, resources etc. Not ideal :-)


Truly helpful but I see some things lacking. One the shell script used does not traverse folders for example if you have organize apps into subfolders. Or have put a app into the Utilities folder the shell script ‘ls” will not list them. It will only list the Utilities Folder. Workarounds might be to change the ls command to perform a recursive listing or maybe use the find command instead as the step in automator to look for applications in the Applications folder.

just my 2cents!

Comments are closed.