878 Views 2 Replies Latest reply: Oct 3, 2006 3:24 PM by 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.