Yup, much simpler than I expected …
You don't even need to use AppleScript for that; it could just be a shell script like:
Code:
#!/bin/sh
for i in 1 2 3; do
/usr/bin/hdiutil compact "/Volumes/Drobo/backup $i.sparseimage"
done
Or even a one-liner directly in the crontab file would work.
I've recently converted regular sparse images to sparse bundles and compacting them runs
much quicker so I wouldn't mind switching to doing it after every backup instead of less frequently under certain conditions. I thought your script might have some clever example for the latter, but instead it helped me realize it can be simpler now.
Thanks!