1Password for Mac is Not Scriptable!

Options
Joelc
Joelc
Community Member

I have an AppleScript that on macOS startup opens a number of applications, opens their related files, and properly positions their windows.

It was time to add 1Password to AppleScript but when I attempted to do so I discovered that 1Password is not scriptable.

Please make 1Password scriptable including an easy way to enter the password!

Thanks!


1Password Version: 8.5.0
Extension Version: Not Provided
OS Version: macOS 10.15

Comments

  • appleianer
    appleianer
    Community Member
    Options

    @Joelc I don't have a pure AppleScript solution for you. I needed a solution how to take into account the opened as well as the locked 1Password Mini. Also, my script knowledge is not the best.

    I found a solution using the app Keyboard Maestro.

    Here is an example of it:

    Video

    https://share.getcloudapp.com/Z4uor6WQ

    Here is the macro I use:

    Yellow: Shortcut to call the 1Password Mini.
    Green: If Then action (screenshots) that checks if the 1Password Mini is unlocked/locked.
    Red: Name of the password - here @iMac

    In this example, the 1Password Mini is already unlocked. If it is not, the Keyboard Maestro macro pauses and waits for the master password to be entered before proceeding with the autofill.

    In this tweet, the autofill login is triggered with the launch of the app (Cryptomator) and then the Finder window is resized for the correct size.

    Here is a YouTube tutorial (unfortunately in German):

    https://www.youtube.com/watch?v=BHaVE9PSE2A

    Please note that the script to open the 1Passowrd Mini unfortunately does not work anymore. Therefore I had to resort to the shortcut.

  • Joelc
    Joelc
    Community Member
    Options

    @appleianer , thank you for the response.

    1. I have never heard of Keyboard Maestro but will take a look when time permits. Interesting, you wrote that your AppleScript knowledge is not the best yet you are using AppleScript in the macro, did you write the code or did you pull it from somewhere?

    2. I hope that someone from 1Password chimes in as it would be a great feature to have. The reason why I would love to have this is that I start 7 apps when I start up my MacBook and all are scriptable except two; 1Password and Quicken fo Mac.

    Thanks.

  • appleianer
    appleianer
    Community Member
    Options

    @Joelc the AppleScript in the macro is quite simple, since basically only the 1Password shortcuts are executed there.
    I had the problem of having the AppleScript pause until I would have entered the master password on a locked 1Password Mini.

    Keyboard Maestro is a very powerful automation tool. I highly recommend it.
    Launch 7 apps; position windows, unlock app etc. and still define if this workflow should be done after starting the Mac's, logging into a specific wifi, maybe connecting a USB device, time based, or simply after entering a shortcut. All without complex scripts. Macro actions already exist for this.

    As already written, I have very little script knowledge, but I created this automation with Keyboard Maestro:

    (1) Autofill login
    (2) Pushover notification about Autofill login
    (3) Button in Pushover notification triggers a Siri shortcut (via iCloud Drive) that takes a snapshot via FaceTime Camera.
    (4) Pushover notification again with the FaceTime Camera image.
    (5) If stranger, then I can lock my keyboard via another Siri shortcut and play a loud shrill alarm sound.

    Video

    https://d.pr/v/XEQi1K

    Thanks to Keybaord Maestro, this also works when someone wakes up the Mac from sleep mode. Has already provided for some scare seconds in the office.
    Since no one touches my MBP anymore πŸ˜‰

    Here is a very further example with Keyboard Maestro, how I edit templates in ScreenFlow without using shortcuts or cumbersome clicking with the mouse, with only one touch gesture (BetterTouchTool).

    Video

    https://d.pr/v/P53f6U

  • I need to look into this more for my personal use. Thanks for sharing @appleianer Sounds very interesting indeed.

  • Joelc
    Joelc
    Community Member
    Options

    @appleianer, I will definitely be looking into this.

    Much thanks.

    Joel

  • appleianer
    appleianer
    Community Member
    Options

    @ag_tommy & @Joelc if you want the autofill login macro I will be happy to give it to you.
    Since Keybaord Maestro provides a trial version, you can always try it out.

    One more tip:
    Since I don't have Mac's with Touch ID, I also use a macro for quick authendification.

    https://forum.keyboardmaestro.com/t/absurdly-simple-1password-solution/24657/6?u=appleianer

    The login is then a little faster. The password then comes from the macOS keychain. This can be used just as securely as 1Password.

  • Joelc
    Joelc
    Community Member
    edited December 2021
    Options

    @appleianer , I took a quick look at the Keyboard Maestro help document and it does look rather complicated not the sort of point and click software I was hoping for.

    Even looking at the script that you posted above it is not obvious / simple to get it to work. What am I missing?

    How steep would you say the warning curve is for someone who has never used it?

    Thanks.

  • appleianer
    appleianer
    Community Member
    Options

    @Joelc I am 52 years old and have only started 4 years ago to deal with automation, due to the purchase of Keybaord Maestro.
    I know almost no English (DeepL online translator πŸ˜‰) and have created hundreds of macros so far.

    At the beginning it looks complicated. There is a very good forum with many helpful users

    https://forum.keyboardmaestro.com

  • Joelc
    Joelc
    Community Member
    edited December 2021
    Options

    @appleianer , alright, I will give it a try, I hope that I can get it to work but I am sceptical! I might reach out to you for some help!

    PS. I am older than you!

  • fwiw I am also in my 50's although a bit younger than @appleianer ;) I started a few years ago as well. It can be very powerful indeed. I would not say it is overly hard. As with anything new, just give yourself some time. I still remember getting started with 1Password 2 over 14 years ago. :chuffed:

  • appleianer
    appleianer
    Community Member
    Options

    @ag_tommy πŸ˜‰

    @Joelc please contact me and you will get the autofill macro with video instructions on how to set it up.
    Best you write me then a DM in the Keybaord Maestro forum. There you can also find me under the nickname: @appleianer

    Please note that you need to add these two programs in System Preferences - Accessibility so that you can work with AppleScript and System Events (shortcuts) in Keybaord Maestro.

  • Joelc
    Joelc
    Community Member
    Options

    @appleianer , I thanks you for your most generous offer. I will certainly DM you once I get Keyboard Maestro up and running.

    Much appreciated.

This discussion has been closed.