Keyconfig customizations

I've read the posts about customizing the hotkeys for creating a new item from the current page, etc., and I've done that with keyconfig. I wonder if there's a way to do further keyconfig settings. For example, I have A LOT of PDFs that I need to link to Zotero entries. Instead of going through all the keystrokes, is there a command for the "Link to file..." function under attachment?

And if you could, could you tell me how to find such things in the bowels of Zotero so I can maybe find others to do?

Thanks!
  • edited June 23, 2009
    (For reference: http://forums.zotero.org/discussion/3637/#Item_4)

    Most code you'd want to call is in ZoteroPane in overlay.js. "Link to file..." is ZoteroPane.addAttachmentFromDialog(true), which you can see by looking at overlay.xul, which is where most of the main UI (buttons, menus, etc.) is defined.

    But it might be quicker just to drag PDFs from the filesystem directly onto items... [Edit: Sorry, forgot you were trying to link, whereas dragging (currently) only imports.]
  • Thanks Dan! That's exactly what I need for attaching all those linked documents. I went to
    chrome://zotero/content/overlay.js
    and looked for
    ZoteroPane.addAttachmentFromDialog(true)
    but I couldn't find it (I was doing that to learn how to look for stuff). I couldn't find the overlay.xul (should I just replace .js with .xul? If so, that didn't work).

    Regardless, this is a BIG help. THANKS!
  • Okay, a little problem. I went home to do all that work and found that the keyconfig customization above adds a link in the main directory -- not to a specific record. Any ideas on how to make it work? Thanks!
  • var ids = ZoteroPane.getSelectedItems(true);
    if (ids.length == 1) {
    ZoteroPane.addAttachmentFromDialog(true, ids[0]);
    }


    Look for addAttachmentFromDialog in overlay.js, not ZoteroPane.addAttachmentFromDialog.

    For overlay.xul you'll need to view the page source if you're using a chrome URL (which actually renders the XUL).

    It's better to use SVN or Trac.
  • That did it! Thank you Dan!
    Aaron
  • So I've tried to figure this stuff out on my own, but alas without real programming skills I've not made it. I tried to create a shortcut for viewing attachments. The best I could come up with was
    ZoteroPane.viewAttachment;
    but it seems like I need something more in there to make it work. I've also got Zotero configured to open the file in the external viewer (Acrobat). Any further help would be appreciated!
Sign In or Register to comment.