10.4: Compact sparse disk images via contextual menu

Mar 29, '07 07:30:03AM

Contributed by: Anonymous

The following Automator workflow will simplify compacting a sparse disk image. You need to occasionally compact sparse disk images, because while they will grow automatically as you add files, they won't shrink when you delete files. Open Automator in Applications Folder, and create this workflow:

  1. Finder Library » Get Specified Finder Items Action
  2. Finder Library » Filter Finder Items, and select Name Extension is equal to sparseimage.
  3. Automator Library » Run Shell Script and select Pass input as arguments and replace the sample script with hdiutil compact $@.
Save as Plugin for Finder (name it Compact Sparse Disk Image). In the Finder, select a sparse disk image and ctrl-click, go to the Automator entry, and select Compact Sparse Disk Image. That's it!

Comments (14)


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