Keyboard shortcut key combo (hotkey) for saving reference in Safari extension

The Firefox and Chrome Zotero extensions allow for a shortcut key (Command—Control—S by default, I believe, in Firefox) to activate "Save to Zotero" functionality, as an alternative to clicking the toolbar button. I can't seem to find a way to get this to work in Safari. Is there a way to do this?

I'm guessing that it's just due to an architectural limit in Safari. In Chrome, to setup a shortcut key I had to do it manually through a settings Pane in Chrome that allowed for shortcut keys to be set up for various extension functionality. I can't find a similar pane at all for Safari.

Thanks!

macOS 10.12.6
Safari 10.1.2
Safari Zotero extension 5.0.21
Zotero 5.0.17
  • Yeah, I don't believe this is supported in the Safari extension architecture, but there's a hacky way we could do it. (It would work when the page was fully loaded and had focus.) We'll look into it.

    (And I'm not sure what's up in Chrome. We register Ctrl/Cmd+Shift+S in Chrome and Firefox, but at least for me (and for you, it sounds like) that stopped working in Chrome in favor of that Keyboard Shortcuts dialog, which doesn't even show the default shortcut.)
  • edited September 21, 2017
    For anyone interested, found a bit of a workaround. You can use the AppleScript code below to "click" the 'save to zotero' button on the Safari toolbar. By triggering the script via a shortcut key (with a Script Launcher tool like FastScripts, for example), you get same effect behavior as the shortcut key functionality available for the Zotero plugins on Firefox and Chrome.

    Note: you may need to adjust the "group 3" part of the code to reflect the order in which the Zotero button appears on your particular toolbar.

    Applescript code:

    tell application "System Events"
    click button 1 of UI element 1 of group 3 of toolbar 1 of window 1 of application process "Safari" of application "System Events"
    end tell
  • @justinrr
    I know I'm 3 years late but thanks for this.

    I can run the AppleScript using BetterTouchTool. Works great (at least for now until Safari updates again...). I had to change it slightly to 'Group 2' since I have my Zotero button to the left of the address bar.
Sign In or Register to comment.