Jun 13, '06 07:30:00AM • Contributed by: scmckenzie
I've written a quick Automator (I love Automator) workflow that uses an embedded bash script to clean up the crud on my hard disk, focusing on Universal applications.
This Automator workflow does two things:
- Removes the PowerPC code from Universal binary applications.
- Removes all non-Enlgish language files.
Here's the program (792KB) [macosxhints mirror]. The basic code used in the workflow is this:
$ /usr/bin/ditto --rsrc --arch i386 "$SFnameO" "$SFnameI"
$ find "$SFnameI" -depth -name "*.lproj" -not -name \
"English.lproj" -print -exec rm -rf '{}' ;
[robg adds: I tested this, and it works as described -- and the results can be dramatic. GarageBand, for instance, shrinks from 100MB to 32MB, and seems to work just fine. But if you are going to use this (or any other such space-saving application), please make sure you have a good backup. As noted in the author's Read Me, you may find some apps that break in some way when modified in this manner, and that might not happen until after you've decided all is fine and trashed the original.
For a normal desktop machine, with large and easily expanded hard drive space, I'm not sure programs such as this are worth the (minor) risk. But on a laptop, where every MB counts, it can make a big difference. On my MacBook, I ran it on only GarageBand, iDVD, iMovie, iPhoto, iTunes, and iWeb, and freed up 482MB of drive space. Note that there are other apps that do this, and we've covered similar scripts here in the past.]
