KeepassX + Keyboard Maestro on OSX
I had written about my love and use of keepass with my Macbook, and was living in bliss until I updated to Mavericks 10.9.2.
After updating I was unable to use Keepass, and could not figure out a way to fix it.
I began to revisit the native ports of Keepass to OSX, but did not find something stable enough for my heavy use. I began to panic. I even contemplated running Windows 24x7 in a VM just to make sure I had Keepass!!
Then I decided to revisit KeepassX. Lo and behold they have come along way since I had used it last, and now includes support if Keepass 2.xx databases! Awesome :)
I downloaded the latest KeepassX Alpha release (Alpha 5 as of this writing) for OSX and went off on my merry way.
It worked great and was very reliable however I immediately began lamenting the loss of the keepass http plugin which I had gotten so used to having.
I do not currently have the time or know-how to contribute this ability to KeepassX, however I thought that I could at least improve the functionality of KeepassX Alpha on my Macbook by using some atomization courtesy of my new favorite tool Keyboard Maestro.
I will definitely have to write a more about how I am using Keyboard Maestro but that is for another day!
This is the Macro I made for keepass:
Click here to see the full sized image of the Macro
What It Is
I use ⌃⌥⇧⌘K to get the party started. The Internet is full of great tutorials, on how you can set a a hyper-key on your Macbook to equal ⌃⌥⇧⌘ , I use my capslock as is often recommended by Mac Power Users to do, as this allows you to freely assign hot-key shortcuts as you see fit without ever worrying about it conflicting with any applications you use.
If KeepassX is not running, this macro simply opens my Keepass database for me then minimizes Keepass.
If KeepassX is already running, it switches to the Keepass window and pauses, until I press ⌘b which is the hot-key in Keepass for copying the "username" for a given entry. Upon copying the username, the macro switches back to the previous window (99.9% of the time this is my web browser) and simply pastes the username, waits a second then presses tab , and then switches back to KeepassX. The Macro then pauses and waits for me to press ⌘c which is the KeepassX hot-key for copying the password, the macro then switches back to the previous window, pastes the password and then presses enter . This usually satisfies MOST website login forms and very rarely do I find myself having to manually copy and paste my credentials.
My traditional use case for this macro:
I am surfing the web and come to a site I want to login to, say like Amazon
I click on the "username" box for logging into my account and then press the hotkey to start the macro ⌃⌥⇧⌘K
I choose the entry for Amazon.com and press ⌘b
I choose the entry for Amazon.com and press ⌘c
Voila! I am now logged in :)
See it action via this short screencast I made.
What It Isn't
This is not as convenient as Keepass2's ability to 'auto-type' nor does it obfuscate the text output like Keepass2 does either.
This does not compensate for the ability to use the http plugin either! It is faster than doing things manually but still not as fast as using the browser plugin.
What Could It Do?
Things I would like to improve upon in the future?
The ability to obfuscate the text output, perhaps using Keyboard Maestro to copy the username's and password into variables or a different clipboard and then running a script to jumble the string of text, and then keeping track of the order so that a dynamic output can be given to a variable as to how to type the password again into a web-form.
The ability to have Keyboard Maestro type in my password to open my .kdbx file, this could be done by saving the password in OSX's keychain and then having Keyboard Maestro get that and use it to log me into myfile. I like using both a password and a keyfile for my Keepass Databases.
Help contribute to the project by working on the ability to use plugins like Keepass2 does.
Hopefully this will be useful for someone out there, to use. Another plus to using KeepassX over Keepass2 is that I no longer have to have Mono on my machine either.
To use this on your Mac all you need is to download and install KeepassX and Keyboard Maestro. If you would like to use my macro or improve upon it, feel free to download it here.
Happy Keepassing! :)














