10.4: Thin out Universal apps and non-English languages

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:

To remove the Universal binary, the workflow makes a duplicate of the program in question, stripping the PowerPC code and renaming the program with _Intel at the end. Once the workflow is done, you can then make sure the modified application works as expected before deleting the original. But please, read the Read Me before proceeding with the workflow!

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.]

Comments (15)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060609195046756