Keyboard shortcut to generate and paste new password (workaround)

Options
csharpminor
csharpminor
Community Member

I've always wanted a way to generate and fill in a new password in a form using a keyboard shortcut and was surprised that no such shortcut exists in 1Password (mini). It turns out I'm not the only one:

Given that dozens of people have been requesting this feature for over a year to no avail, it's perplexing that Agilebits apparently has no intention of following through on this request. So, here's a workaround I came up with using Automator and system services.

  1. Open Automator
  2. Choose the "Service" type for your new document.
  3. In the search box for the Actions library, type "applescript".
  4. "Run Applescript" should be one of the search results. Drag that item to the workflow area on the right.
  5. Delete (* Your script goes here *) and paste in the code from this gist.
  6. Above the workflow editor, change the first drop down for "Service receives" to "no "input" and check "Output replaces selected text".
  7. Save the workflow with the name "Generate password". Here's a screenshot of how it should look when completed:
  8. Open System Preferences > Keyboard > Shortcuts tab
  9. Select the "Services" category on the left.
  10. Under the "General" dropdown on the right, you should see your "Generate password" service listed.
  11. Check the box for that item and give it a keyboard shortcut. Screenshot:
  12. Within text inputs in any application, the keyboard shortcut will generate and paste a new password.

You can tweak the character pool and password length in the gist to your liking.

Comments

  • redzep
    redzep
    Community Member
    Options

    Wow, I admire your persistence! Gonna try this. I agree that it's baffling that Agile would allow so much keyboard navigation only to stop short one step before the destination, namely being able to !(&@# paste a freakin generated password... nope gotta go get the mouse, like an animal.

  • Hi guys,

    Thanks for letting us know you've been waiting for this. I know how you feel, I've asked for this a while ago for myself as well, and this is still one of the most popular requests we get. I've added both of your feelings to our tracker on this.

    Given that dozens of people have been requesting this feature for over a year to no avail, it's perplexing that Agilebits apparently has no intention of following through on this request.

    We never said that we won't do this. It is still an open major improvement request in our tracker and we want to do this in the future. However, we have to prioritize certain things given our limited resources and that means it takes some time.

    Be careful with using the script offered here, any password you generate will not be automatically saved in 1Password, it will not be cleared automatically in the clipboard and it is not as flexible as 1Password's generator options like length, symbols, and/or separators since you have to manually edit it each time to fit the requirements.

  • TriAthDance
    TriAthDance
    Community Member
    Options

    In the ~15 years of using a couple of Macs I've never gotten around to using AppleScripts or Automator. So i did everything here ... but now what? How do I activate it?

  • littlebobbytables
    littlebobbytables
    1Password Alumni
    Options

    Hi @TriAthDance‌. Did you assign a keyboard shortcut to the script as instructed in step 11, as well as checking the box? If you did that then the shortcut assigned to it should be all you need to use to run the script.

    Please note MikeT's response though as to some of the limitations of using it compared to the built-in version. We wouldn't want anybody losing a password by accident for whatever reason.

This discussion has been closed.