Archive. This is an archive of the Apple Support Community. Discussions are being restored and soon you will be able to read and post here again.

How to use diskutil in AppleScript to attach disk images

hdiutil deprecating


I understand that hdiutil is deprecating to diskutil.


I currently use hdiutil frequently and wonder how/if I can change the Applescripts to include diskutil

Here's an example:

try

do shell script " hdiutil attach  /Users/lakevz/Documents/lectures/current.dmg"

end try


I tried substituting diskutil for hdiutil leaving attach and it brought up box for password but went no further despite correct password and had to shut down the mac to get rid of the password box. Force quitting script editor or logging out wouldn't work.



Is there a way to change the script to have it work with diskutil?

Thanks

2 replies

UPDATE


Got it to work.

Strangely, the password is all caps and the caps lock key was on.

With it on, it doesn't work…with caps lock off and holding shift key it works


I guess this is a bug as it seems unreasonable for this not to work with caps lock on when all caps for password is appropriate?

Sorry, I substituted diskutil image attach for hdiutil attach