Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using a applescript to mount my harddrive.

At the moment im using:

do shell script "diskutil mountDisk diskutil list | grep \"Harddrive\" | grep -o 'disk[0-9]*'"

Now i want to do the same but with a encrypted drive.

how can i fill te password in this script?

share|improve this question
up vote 0 down vote accepted

From StefanK at MacScripter:

property thePassword : "•••"
do shell script ("/bin/echo -n " & quoted form of thePassword & " | /usr/bin/hdiutil attach -stdinpass /Volumes/ExternalDisk/ImageName.dmg")
share|improve this answer
It seems that you accepted the answer, does this work for you now? – adayzdone Jan 29 '13 at 19:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.