This is a simple bash script to create DMG under Finder.

for f in “$@” do b=$(basename “$f”) d=$(dirname “$f”) hdiutil create -format UDZO -srcfolder “$f” “$d/$b.dmg” done

You can use this simple script combined with Automator such that you can create disk image files by selecting files or directories and using the Automator context menu in Finder.

Automator setup

200607231435

Usage:

200607231435-1