Scripting or Programmatically Driving 1P for Autofill

Options
derzzle
derzzle
Community Member

I was wondering if there is an available API (scripting or Framework) to script or drive 1Password 4 programmatically? Here's my use case, just so you know that: (1) I am not (completely) stark raving mad; and (2) there is a valid use.

Depending on the one of several specific tasks I am engaged in, there are related sets of tabs that I use (at the very least start with)—most requiring authentication. For example, if I am working on a [coding] feature, I usually start with a JIRA issue, a couple of Confluence pages, a view into one or more doc pages related to the task, github/gitorius/.., cloud control panel, deployment tool; if I then switch to role of release engineer, there's Confluence, Nexus, Jenkins/Hudson [if Java, as e.g.] plus release notes, Git; if I am in the Lab, some papers, wiki, data library/CMS, supplies / parts ordering or sourcing,… you get the genral idea.

Being able to open a bookmarks folder as a set of tabs is the first step here. But then I have to hit Ctrl-Cmd-] then Ctrl-Option-/ (next tab, autofill login) upwards of 12–14x several times (yup, at least five on a typical day)… and for a guy with severe CTS, it's not so much fun. When I work from home, it's not so much a hassle anymore as I use one of Pi Engineering's programmable key consoles with ControllerMate. However, when I'm on the laptops or at my office…

Ideally, I'd like to be able to (say) manually unlock the 1P keychain, hit "Open in Tabs" on a BM folder and …. "magic happens." Alternatively, could drive from AppleScript or similar.

Thanks!

Comments

  • Hey @derzzle,

    First of all, AgileBits has been super busy since the launch of 1Password 4, and I'm sure they're very sorry for such a long wait for a response. But I'll see if I can help in the mean time.

    I don't believe 1Password offers an API or anything like that, but here's a possible solution:

    There's something that 1Password offers called 1Click Bookmarks. They're basically a link that will take you straight to a site and log you in. You might be able to use this for your case. Here's a link to an article with more info about 1Click Bookmarks if you'd like (it's for 1Password 3, but same idea).

    So to find the 1Click Bookmark for a login item in 1Password, you can simply drag a login from the list in the main 1Password app to a text editor. The bookmark link will appear in the text editor and should look something like this: http://www.example.com?onepasswdfill=A94A8FE5CCB19BA61C4C0873D391E987

    Now how could this possibly be helpful in your case? Hopefully with AppleScript.

    I'm not too familiar with AppleScript, and my script isn't ideal, but this did work for me:
    tell application "Safari" to activate tell application "Safari" open location "http://www.example1.com?onepasswdfill=A94A8FE5CCB19BA61C4C0873D391E987" delay 4 open location "http://www.example2.com?onepasswdfill=109F4B3C50D7B0DF729D299BC6F8E9EF" delay 4 open location "http://www.example3.com?onepasswdfill=3EBFA301DC59196F18593C45E519287A" end tell
    This opened three tabs for me and logged them all in. Unfortunately I had to add in the delays so the page had time to load, and 1Password had time to fill the login before opening the next page. I don't think 1Password can fill in the background, only on an active page. Maybe you could come up with something better in the AppleScript department.

    I'm not sure if this is exactly what you're looking for, but hope it helps! :D

This discussion has been closed.