TheMacMind's Cortland Haws takes a look at the hdiutil command line program.
Read the article to see why sparse disk images are almost magical. Using the example command given in the article, here's a simple way to wrap it in AppleScript:
Read the article to see why sparse disk images are almost magical. Using the example command given in the article, here's a simple way to wrap it in AppleScript:
set newDiskName to "SecureSparse"
set newDiskSize to "1g"
set shellCommand to "cd ~/Desktop; hdiutil create "& newDiskName &" -size "&¬
newDiskSize &" -encryption -type SPARSE -fs HFS+ -volname "& newDiskName
do shell script shellCommand
Note: The example creates a 1GB disk image on the desktop. This can be changed easily by modifying the value of the variable 'newDiskSize'. I feel compelled to repeat the advice given in the article: "For more information on hdiutil, enter 'man hdiutil' in the Terminal." [AppleScript Info]set newDiskSize to "1g"
set shellCommand to "cd ~/Desktop; hdiutil create "& newDiskName &" -size "&¬
newDiskSize &" -encryption -type SPARSE -fs HFS+ -volname "& newDiskName
do shell script shellCommand