Hi! I would like to ask if any of you have tried scripting Disk Copy application in OSX.
I would like to create a blank image in Disk Copy but the script I tried to run is
Here’s the snippet of my code:
set image to "ThisDisk.dmg"
tell application "Disk Copy"
make new image
Please help me on this. Thanks.
No can do. At least, not directly.
Disk Copy is another shining example of Apple’s support of AppleScript. The dictionary doesn’t contain enough options to do this.
About the only recourse is GUI scripting, emulating selecting the menus and clicking the various options to create a file as you’d do it manually
If you aren’t opposed to using the shell, you might open a Terminal window and issue the following command (to read the manual): man hdiutil
Here’s sample code that will create a 10 MB sparse disk image named “Sparse” on the desktop.
set newDiskName to "Sparse"
set newDiskSize to "10m"
set shellCommand to "cd ~/Desktop; hdiutil create " & newDiskName & " -size " & ¬
newDiskSize & " -type SPARSE -fs HFS+ -volname " & newDiskName
do shell script shellCommand
Note: I don’t know if ‘hdiutil’ is installed by default. It might be part of the dev tools or BSD.
Thank you Rob. It really gives me an idea to do it in shell script rather than apple script. hdiutil is really an alternative. Thank you.