This discussion is archived
628 Views 2 Replies Latest reply: Oct 3, 2006 3:24 PM by Khadrelt
Currently Being ModeratedOct 3, 2006 12:34 PM (in response to Khadrelt)Something like this should work:
set myResult to display dialog "Enter password:" default answer "" with hidden answer
set thePW to text returned of myResult
set cmd to "echo -n \"" & thePW & "\" | hdiutil attach /path/to/encrypted/disk/image.dmg -stdinpass"
do shell script cmd
There are some security concerns with passing a command string to "do shell script" that contains your password. If other users log on to your machine they could see your password if they happened to be watching the process list at just the right time.
Steve20" iMac G5, Mac OS X (10.4.7)