Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

When is a disk image file encrypted?



My script is designed to compress (UDZO) [and optionally encrypt] a read-write (UDRW) or an uncompressed read-only (UDRO) disk image file. It should ignore other disk image files. It should ignore any encrypted disk image file. Here is the script to test that ...

try
	"hdiutil imageinfo " & sourceImage & " -format"
	set dmgInfo to (do shell script the result)
on error
	-- notify user that format is not available
	return
end try
if dmgInfo is not in {"UDRW", "UDRO"} then
	-- notify user that input file is not right format
	return
end if

If the dmg file is encrypted, the 'do shell script ...' shows a dialog asking for the password. I see the illogic of this and simply click Cancel. My users will probably be confused by this dialog. To avoid the dialog, I need to be able to determine if the file is encrypted WITHOUT reading the file. Or I need to be able to supress the password dialog, if possible.

The 'hdiutil imageinfo ...' command, without '-format', does return encryption status, but not until you enter the password via the dialog.

I've looked at the DiskImageMounter application. It's scriptable, but no commands to handle encryption.

Any ideas? ... or am I screwed?

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.