Created
March 3, 2018 20:43
-
-
Save pudquick/470bcd976b104942c9cfd7234a9814fa to your computer and use it in GitHub Desktop.
Make DMGs from folders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property destination_for_dmgs : "/Users/mike/Desktop" | |
on open the_items | |
repeat with an_item in the_items | |
set the_info to info for an_item | |
if kind of the_info is "Folder" then | |
set dmg_path to quoted form of (destination_for_dmgs & "/" & (name of the_info) & ".dmg") | |
set src_path to quoted form of POSIX path of an_item | |
set vol_name to quoted form of (name of the_info) | |
set command_str to "hdiutil create " & dmg_path & " -volname " & vol_name & " -srcfolder " & src_path | |
do shell script command_str | |
end if | |
end repeat | |
end open |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment