Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

An AppleScript to compact sparse images System
To keep some files secure on a USB thumb drive, I decided to use an Encrypted Sparse Image, which can be created in Disk Utility on Mac OS X 10.3. Unfortunately, Disk Utility does not have the ability to reclaim free space on a Sparse Image, and the Finder won't do so automatically either. So in order to be able to compact the Sparse Image and not fill up the thumb drive, I wrote this AppleScript that will compress a Sparse Image. To use this script, it needs to be saved as an application. Then just drop a Sparse Image over the application's icon and you're done.
on open this_item
  set this_item to quoted form of POSIX path of this_item
  do shell script "hdiutil compact " & this_item
end open
[robg adds: A previous hint provided the hdiutil command line solution; this is just a nice AppleScript wrapper for that command. If you're running a pre-10.3 system, this older hint explains how to create sparse images -- read the comments, though, as it seems the site linked in the main article has gone away, at least as of this morning when I tested it.]
    •    
  • Currently 3.00 / 5
  You rated: 3 / 5 (4 votes cast)
 
[5,509 views]  

An AppleScript to compact sparse images | 1 comments | Create New Account
Click here to return to the 'An AppleScript to compact sparse images' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to compact sparse images
Authored by: Jwink3101 on Jan 12, '05 08:17:40PM

Very cool. I use it almost everyday. Thanks



[ Reply to This | # ]