tell application "System Events"
set frontmostApplicationName to name of 1st process whose frontmost is true
open location "onepassword://extension/search/{query}"
set frontmost of process "1Password 7" to true
key code 48
key code 124
key code 125
key code 36
set frontmost of process frontmostApplicationName to true
end tell
How to copy a password from 1password?
in Discussion & Help
Posted
I made a version that's a bit faster and also restores focus to the frontmost app when called. You may need to add in some delays.
https://github.com/delikat/alfred-workflows/raw/master/1Password Copy.alfredworkflow