Script to copy 1Password 7 username and password with keyboard shortcut trigger

I want to create a keyboard trigger that automatically copies the username and password on 1Password 7 app in the clipboard and when copy the username should go in the first line of the clipboard while the password goes into the second line.

I hope I made it clear about what I want to achieve here. I am not sure what I should be using here and if the apple script would work with it or not.

1 Like

I don't think the 1Password app is scriptable at all. There is no AppleScript dictionary for the app.

You might be able to build something automate-able (is that a word?) using the 1Password-CLI tool:

See
https://support.1password.com/command-line-getting-started/

and then
https://support.1password.com/command-line/

1 Like

Hi @abbas_zahid,

with this AppleScript you open 1Password Mini for a short moment and can copy the username (here iCloud Account):

tell application "System Events" to tell process "1Password mini"
open location "onepassword://extension/search/iCloud"
end tell
delay 0.4
tell application "System Events" to tell process "1Password mini"
keystroke "c" using {command down, control down}
end tell

With this AppleScript you copy the password:

tell application "System Events" to tell process "1Password mini"
open location "onepassword://extension/search/iCloud"
end tell
delay 0.4
tell application "System Events" to tell process "1Password mini"
keystroke "c" using {command down, shift down}
end tell

I'm not so good with AppleScript that I could tell you how to get both of them together and under each other into the clipboard.
Maybe someone can help here in the forum.

What exactly do you want to do with it? What kind of accounts do you want to open with it? On apps on the Mac or the Internet?

I created this macro to log into my user account, my iCloud account or other apps on the Mac.
I've added the "click a found image actions" to pause the macro until I've unlocked the 1 password mini if necessary.

iCloud

In this video I show some examples how I use the 1Passwort Autofill macros with me. Just for info the shown examples were still using 1Passwort 6

1 Like

Hi @appleianer thanks for replying.

I just need to copy username and password to the clipboard with a keystroke when I am on the 1password. So my clipboard would look like this:

username@abc.com
123pass (password goes in the second line)

Thanks for the info :+1: Just not at the Mac
I'll check in later and get back to you.

@appleianer

OK take your time mate

Hi @abbas_zahid, I tried a little bit...
Your intention cannot be realized with the 1Password Mini, because it will be closed immediately after a copy process.

However, if you call the 1Password app it works to copy the username and password into a KM clipboard.
Perhaps someone here in the KM Forum will come up with a more elegant solution. Let me know how things work for you.

Please don't forget to delete both from the clipboard :shushing_face:

Account & Password.kmmacros (3,4 KB)

Account%20%26%20Password

2018_10_15%20Forum

1 Like

Wow. I will check this. BTW how did you made the video? it looks cool.

Thank you :smiley:

I make my videos/GIFs with the software ScreenFlow.
I think it's good to show my macros in execution/action whenever possible.

Since my English is not very good (online translator), it is always easier for me to understand if I can also see sequences in a video and if necessary also imitate them.

2 Likes