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
incorrect.
Here’s the snippet of my code:
set image to "ThisDisk.dmg"
tell application "Disk Copy"
activate
make new image
end tell
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
Rob
July 14, 2003, 1:32pm
#3
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.
– Rob
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.