Take the 2-minute tour ×

Short version: Is there a way to force text field in OSX to accept pasting a string, despite that the developer (Apple) set it to not to accept copy-paste?

Long story:

Platform: OS X 10.8.2 (Mountain Lion)

Just connected a new external drive, set it to be encrypted (HFS+ encrypted partition). It works as expected.

The problem I have is that I have set a long, randomly generated password. As many others, I have saved this one in KeePassX. Everything would be great... except of the fact Apple does not allow me to simply paste a password into "enter password" dialog that is displayed after connecting a drive!

It is very annoying to rewrite long, random string from one window to second one each time when drive is detected. Is there any way to force the input field to accept pasted password?

To unlock disk "***", type password.

One solution would be storing password in OS X KeyChain, but... it seems that there is a bug with that. The 'input password' window does not disappear even after properly mounting a volume. I type password, click 'Unlock' and the controls are grayed out. After a few seconds, I see that drive appears in Finder, but 'input dialog' windows shakes like in case when wrong password was typed - and reverst back to it's original state. Additionally, despite of checked option to store password in KeyChain, it is not written there (I suppose those two may be related). So, checking "Store in keychain" does not solve my problem...

share|improve this question
add comment

3 Answers

up vote 6 down vote accepted

It's not really more convenient in this case, but you could run this in AppleScript Editor:

tell application "System Events" to tell process "SecurityAgent"
    set value of text field 1 of window 1 to the clipboard
    click button 1 of window 1
end tell

When I clicked the remember in keychain checkbox, the password was saved in the login keychain with the name of the volume, and the volume was subsequently mounted without requiring a password.

share|improve this answer
Well, this was a lot more convenient to me, since typing in my password would probably have taken ~20 minutes to get right :D –  mikl Jul 25 '13 at 10:46
It seems the update to OS X 10.8.5 has broken this somehow. Now I get this error: error "System Events got an error: An error of type -25133 has occurred." number -25133 –  mikl Sep 14 '13 at 14:49
Works like a charm! I ended up replacing click button 1 of window 1 with keystroke return because it couldn't find the button index. –  bobmagoo Dec 31 '13 at 17:56
add comment


share|improve this answer
add comment

I tried the one way I thought might get around the cut & paste prohibition, which was to try using ctrlK and ctrlY, (Kill and Yank), but that also does not work.

This of course, gets back to the rationale of having a long, difficult encryption key to enhance security, but then having several copies of that key readily available in memory which can be accessed by any unprivileged process. However, there are several dozen 3rd party password managers, many free, on the App store that may meet your needs.

share|improve this answer
add comment

Your Answer


