Setting Shortcuts through Terminal

thenaos
thenaos
Community Member

Hi everyone,

I’m trying to create a script that quickly sets up 1Password with my preferred settings on new machines, and also “syncs” my 1Password settings between Macs. I’ve been desperately trying to configure 1Password’s shortcuts as depicted below — through the Terminal. Needless to say — to no avail.

Here’s the code snippet I’ve been using to achieve this:

defaults write com.agilebits.onepassword7 "ShortcutRecorder BrowserActivation" -dict-add "keyChars" -string "\034"
defaults write com.agilebits.onepassword7 "ShortcutRecorder BrowserActivation" -dict-add "keyCharsIgnoringModifiers" -string '|'
defaults write com.agilebits.onepassword7 "ShortcutRecorder BrowserActivation" -dict-add "keyCode" -int 42
defaults write com.agilebits.onepassword7 "ShortcutRecorder BrowserActivation" -dict-add "modifierFlags" -int 1966080
defaults write com.agilebits.onepassword7 "ShortcutRecorder BrowserActivation" -dict-add "modifiers" -int 6912

defaults write com.agilebits.onepassword7 "ShortcutRecorder GlobalActivation" -dict-add "keyChars" -string "'"
defaults write com.agilebits.onepassword7 "ShortcutRecorder GlobalActivation" -dict-add "keyCharsIgnoringModifiers" -string '"'
defaults write com.agilebits.onepassword7 "ShortcutRecorder GlobalActivation" -dict-add "keyCode" -int 39
defaults write com.agilebits.onepassword7 "ShortcutRecorder GlobalActivation" -dict-add "modifierFlags" -int 1966080
defaults write com.agilebits.onepassword7 "ShortcutRecorder GlobalActivation" -dict-add "modifiers" -int 6912

defaults write com.agilebits.onepassword7 "ShortcutRecorder GlobalLock" -dict-add "keyCode" -string '-1'
defaults write com.agilebits.onepassword7 "ShortcutRecorder GlobalLock" -dict-add "modifierFlags" -int 0
defaults write com.agilebits.onepassword7 "ShortcutRecorder GlobalLock" -dict-add "modifiers" -int 0

I also gave a try to PlistBuddy, in the following way:

/usr/libexec/PlistBuddy -c "Delete \"ShortcutRecorder BrowserActivation\"" ~/Library/Containers/com.agilebits.onepassword7/Data/Library/Preferences/com.agilebits.onepassword7.plist
/usr/libexec/PlistBuddy -c "Add \"ShortcutRecorder BrowserActivation\":\"keyChars\" string \"\\034\"" ~/Library/Containers/com.agilebits.onepassword7/Data/Library/Preferences/com.agilebits.onepassword7.plist
/usr/libexec/PlistBuddy -c "Add \"ShortcutRecorder BrowserActivation\":\"keyCharsIgnoringModifiers\" string \"|\"" ~/Library/Containers/com.agilebits.onepassword7/Data/Library/Preferences/com.agilebits.onepassword7.plist
/usr/libexec/PlistBuddy -c "Add \"ShortcutRecorder BrowserActivation\":\"keyCode\" integer 42" ~/Library/Containers/com.agilebits.onepassword7/Data/Library/Preferences/com.agilebits.onepassword7.plist
/usr/libexec/PlistBuddy -c "Add \"ShortcutRecorder BrowserActivation\":\"modifierFlags\" integer 1966080" ~/Library/Containers/com.agilebits.onepassword7/Data/Library/Preferences/com.agilebits.onepassword7.plist
/usr/libexec/PlistBuddy -c "Add \"ShortcutRecorder BrowserActivation\":\"modifiers\" integer 6912" ~/Library/Containers/com.agilebits.onepassword7/Data/Library/Preferences/com.agilebits.onepassword7.plist

Didn’t work either!

Help would be very appreciated.

Thanks!


1Password Version: 7.2.2
Extension Version: 7.2.2
OS Version: 10.14.1
Sync Type: iCloud

Comments

  • thenaos
    thenaos
    Community Member

    Anyone? Would really appreciate some help here...

    Sorry for the bump...

  • Lars
    Lars
    1Password Alumni

    @thenaos - sorry for the delay in our response, we've been pretty swamped with support requests recently, with the simultaneous release of 1Password 7 for Windows and 1Password 7 for Mac as well as the substantial changes brought about by Apple in macOS 10.14 (“Mojave”) and Safari 12.

    Unfortunately, what that means is that none of us really have the kind of spare time needed to dig in on this and assist you. Although obviously, it's 1Password-related and it looks as if it could be both a fun and somewhat useful project, it's outside of the purview of what we formally support in 1Password for Mac. And with hundreds of people in this forum and a couple of thousand in email waiting for help with things we DO support, I'm afraid I'll have to let this one go with just a couple of cursory observations, unfortunately. Other forum denizens/1Password users who take an interest are welcome to jump in here, but my only real note of caution is that syncing preferences seems like a risky idea. For one thing, 1Password is not set up to accommodate or even recognize this being done via script/remotely, so it might very well overwrite them when running (depending on what you have "synced"), or even wind up crashing on you. Of course, it's also possible you can figure out a way around that, but again, that's not formally a feature we offer in 1Password -- or offer to support. Definitely keep us updated if you discover anything interesting, though -- we're always keen to learn about unusual/unsupported ways people have managed to use 1Password. Cheers! :)

This discussion has been closed.