Random Password

Download (v3)

Version 3 adds a Growl confirmation when the password is successfully copied.

If you don’t like Growl notifications, you can disable them on any Alfred extension by going into the advanced settings for that extension:

If you want an audio notification, you’ll need to make a simple change to the Random Password php file. Find it by right/ctrl-clicking on the extension and choosing Show in Finder:

Open pass.php. Find

shell_exec( "echo '{$pass}' | tr -d '\n' | pbcopy");

near the end. Add below it:

shell_exec( 'afplay /System/Library/Sounds/Glass.aiff');

Of course, you can browse that directory for alternate sound files. You can even use the ‘say’ command instead for slightly more eerie confirmations:

shell_exec( 'say "password copied"');

Download (v2)

Generate a random password (alpha-numeric, mixed case) and automatically copy it to your clipboard.


> password
Uses default length of 12

> password 10
Creates a 10 character password

> password 12 strong
Creates a 12 character password with some special characters (!@#$%^&*())

> password 16 stronger
Creates a 16 character password with more special characters (-_ []{}<>~`+=,.;:/?|)

Download (v1)

Version 1 requires you to specify a length and does not provide ‘strong’ and ‘stronger’ options.
> password 10
Where ’10’ is how many characters the password should be

You can download Alfred App for free here: http://www.alfredapp.com/.

To kick things up a notch with extensions and more, get the Powerpack for Alfred.

11 thoughts on “Random Password”

  1. This is fantastic — thank you. One question: How can I edit the script to change the strength modifiers from strong and stronger to s and ss? I changed the keyword from password to pw, but that one is easy 🙂 I’m a photographer, not a coder, so I’m afraid I’m not confident enough to guess at what to change in the code.

  2. I am not a coder! If any who knows better can correct me here, please do. But, in an effort to answer David LaSpina above and anyone else who may want to know how to change the Strong and Stronger shortcuts, here is what I did and what seems to be working.

    View the workflow in Alfred. Double-click on the Script Filter. Scroll down about 2/3 of the way until you see:

    if ( in_array( ‘stronger’, $q ) ) {

    And a similar line about six lines down referencing the ‘strong’ keyword. Simply change stronger and strong to what you would like to type instead. For instance, ‘ss’ and ‘s’. Don’t remove the single quote marks, though!

    I figured this out through a little trial and error and it seems to be working for me. Again, if I am making a error, someone please let me know. Otherwise, I hope this helps someone.

Leave a Reply

Your email address will not be published. Required fields are marked *