Create Disk Image

Summary: Demonstrates how to create a disk image using AppleScript.
Requires: DropDMG 3.0
Last Modified: 2019-10-02

Description

This script shows how to create disk images using DropDMG. See also the examples in Saved Settings Droplet.

Installation Instructions · Download in Compiled Format · Download in Text Format

Script

tell application "DropDMG"
    
set _folder to POSIX file "/Users/<username>/MyFolder"
    
    
-- Use the default options.
    
create from file _folder
    
    
-- Specify options directly.
    
create from file _folder format zlib compressed with append version number
    
    
-- Specify options via a configuration.
    
create from file _folder configuration name "My Config"
    
    
-- AppleScript has a default timeout of 2 minutes; increase this for large disk images
    
with timeout of 60 * 10 seconds -- 10 minutes
        
create from file _folder
    
end timeout
end tell