Forum member 1008com wrote an AppleScript that creates and manipulates disk images, and the thread discussing this AppleScript can be found here. It appears to do a lot of useful stuff.
I didn’t know what use I would have for a disk image, and Google AI explained as follows:
The purpose of a disk image on a Mac is to act as a single file that contains the contents and structure of a disk, serving as a convenient way to back up, protect, and distribute files and software. Key uses include creating encrypted archives for sensitive data, packaging software installers, and providing a container for Time Machine backups.
The Shortcuts app has a Make Disk Image action, and its operation is fairly straightforward. A few comments:
-
Multiple source folders can be added to the disk image.
-
The shortcut included below assumes one source folder, and the file name of the disk image is the name of the source folder with a date/time stamp appended. With multiple source folders, a different file-name would be necessary.
-
The Size to Fit Contents option creates a sparse disk image, which only consumes as much disk space as is required for the data in the image. Normally, this option would be enabled.
-
The Image Size option only sets the maximum allowed image size. The 1 GB option I used is arbitrary.
-
Making a disk image takes a fair amount of time regardless of the amount of data included in the disk image.
-
I was unable to create a disk image of my smallish home folder.
-
Other disk-image-related actions are Mount Disk Image and Eject Disk.
Create and Save Disk Image.shortcut (22.6 KB)
