简体   繁体   中英

AppleScript, which calls Disk Utility to make DMG file

How can I make Apple-script file, which calls Disk Utility (usual OS X app) and makes it create DMG file from fixed folder (eg folder "../dir/dir2").

Is it possible to do this, using Apple-script? I use OS X 10.8 here.

You can do it without opening Disk Utility.app

set sourceFolder to "/Users/myuser/path/to/folder/"
set dmgPath to choose file name
do shell script "/usr/bin/hdiutil create " & quoted form of POSIX path of dmgPath & " -ov -srcfolder " & quoted form of sourceFolder

You will prompted to provide a destination file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM