Drag&Drop and Pasting not working on Mac standalone

This is the Mac standalone version 4.0.4.

Drag&drop fails to work with BibDesk. I tried dragging&dropping a couple of citations from BibDesk to Zotero, and that did absolutely nothing.
When dragging from Zotero to BibDesk, I get an "unsupported or invalid format error" from BibDesk, so this could be a problem with either App. Generally, BibTex formatted records can be imported via copy&paste into BibDesk, so I suspect Zotero does not provide the right format.

Similarly, Command-V "Paste" does not work for BibTex records. The File->Import from Clipboard function works correctly, but I don't see how the semantics of this should be any different from Command-V. That's perhaps "just" a UI problem.
  • dragging bibtex records into Zotero isn't supposed to work - dragging files into Zotero attaches them as items, doesn't import reference data.

    Command+v typically pastes text, your expectation that it would import bibliographic data must come from a very specific set-up you're used to, I think if anything it'd be confusing for many users.

    If you drag from Zotero and want bibtex, you need to have it selected as the default export format in the Export tab of the Zotero preferences. By default drag&drop defaults to a citation style. I don't know if bibtex accepts that, though.

    If you're using BibDesk, have a look at the zot2bib
    http://mackerron.com/zot2bib/
    though I'm not sure it's compatible with Standalone/Zotero4 - if it's not, ping the user.
  • Thanks for the zot2bib link. I was aware of some plugins for synchronization, and that's what I'll need going forward.

    As for drag&drop, copy&paste functionality, I do think that these expectations are pretty standard.

    You're saying the Command-V pastes text? In GIMP or Photoshop, does that mean Copy & Paste would no longer work? Or in OmniGraffle or InDesign or QuarkExpress, can you no longer paste graphical objects? Or in Audacity or ProTools, can you not cut, copy and paste audio segments? In a bibliography manager, I would expect to be able to copy and paste records. And since the serialization of these records is well-standardized (BibTex, etc.), drag&drop functionality between applications should work!

    The Cocoa Pasteboard API supports multiple formats in parallel, although I'm not sure if there are MIME types for BibTex records. So thank you for the pointer to the preferences, I'll try that out.
  • edited April 15, 2013
    fair enough on images etc. - but it still pastes whatever is on the clipboard into a document & doesn't import it. That seems quite distinct to me. My point about text was that when you copy bibtex, what's in your clipboard is plain text so that's what I'd expect to be pasted on cmd+v.

    If you drag an entire bibtex file then yes, I guess Zotero could distinguish that by mimeType (bibtex is in theory application/x-bibtex or text/x-bibtex - not sure how consistently that's set) though I wonder if that's really worth implementing? What's the use case where you need that functionality a lot?
  • "whatever is on the clipboard"?
    First, there can be multiple formats on the clipboard. Second, when you have an image on the clipboard, does it paste the binary data with a lot of gibberish into your Word document when you hit ^V? No, of course not.
    It pastes the most detailed, yet interpretable version of the data in the clipboard into the current document, in the appropriate form.

    As far as I remember, anything on the Cocoa Pasteboard has a MIME type.

    BibTex is not just text. It's a serialized representation of a record, just like a .jpeg is a serialized representation of an image, or an HTML or RTF chunk of text represents formatted text. There's no difference. Not from the user's perspective, and hopefully not from a sophisticated programmer's perspective, either.

    USE CASE:
    Every time I look up a document on Google and land on a publisher's website, and they will let me export the citation as BibTeX, I will do so. And then I copy and paste whatever I see in my browser into my bibliography manager. That is a very common thing to do, and a good use case. (Drag&drop of the text chunk, as is possible on the Mac, should be supported as well.)

    (Also, what else than to insert the record should Command-V do?)
  • Zotero isn't written in Cocoa and doesn't have direct access to Cocoa APIs. Last I checked, the XULRunner/Firefox clipboard APIs only supported a limited range of MIME types, although admittedly it's been a while since I looked into this. As you note, this limitation is likely artificial. However, to circumvent it, we would have to either get a patch included into Firefox or use js-ctypes and possibly a C wrapper to implement clipboard functionality ourselves. It's possible that we will do this in the future, but it's not entirely trivial. If you want to take a crack at it, we're always happy to take patches.
  • edited April 16, 2013
    USE CASE:
    Every time I look up a document on Google and land on a publisher's website, and they will let me export the citation as BibTeX, I will do so. And then I copy and paste whatever I see in my browser into my bibliography manager. That is a very common thing to do, and a good use case. (Drag&drop of the text chunk, as is possible on the Mac, should be supported as well.)
    Three things on that -
    1. in my experience it's increasingly rare that you would get bibtex on a site that _doesn't_ have a Zotero URL bar icon. Do you have any examples?
    2. I haven't looked into that, but it may very well be possible to assign a keyboard shortcut to the "import from clipboard" function - especially if you're using FF and can use keyconfig
    3. Zotero does automatically import downloaded RIS/Refer files served with the right mimeType. I see no reason it shouldn't also do that with text/x-bibtex styles (Mendeley takes those, for example). @Simon - are there any principled reasons for that?
  • Well, I would, but I've already got too many projects of my own.

    So, I'll look at it from a user's perspective.
    And as user, it really does not matter what the underlying technology is... if it's a standalone Mac program, I expect it to behave like one...

    That said, I'm taking a look at the clipboard contents right now coming out of BibDesk.
    During normal Copy, It looks to me like BibDesk just puts the citation (\cite) on it, and the full record, but in a proprietary binary format (presumably a serialization of some internal objects).
    During Copy as BibTeX record (it can copy in different variants, just like many Mac programs), it just puts a public.utf8-plain-text up there.

    So, that should be recognizable as a BibTex entry.

    I think Zotero could just try to parse the clipboard as a record upon a standard Paste, and if that fails, back up to the regular pasting (whatever that is) without error message. If it succeeds, you continue to do a Paste From Clipboard.
  • As for your point 3), if you do this, I would be happy to submit a request or a patch to BibDesk to make it export to the clipboard as text/x-bibtex in addition to the standard text string. (I don't really use Mendeley much.)
  • I haven't looked into that, but it may very well be possible to assign a keyboard shortcut to the "import from clipboard" function
    There already is one by default: Cmd-Shift-V. It'll parse and import BibTeX or any other import format on the clipboard.
    BibTex is not just text. It's a serialized representation of a record, just like a .jpeg is a serialized representation of an image, or an HTML or RTF chunk of text represents formatted text.
    That's fair, but I think the weird part is creating a record (or, potentially, many new records) on a paste. This really isn't analogous to any of your examples, which, as adamsmith says, are pasting into an open document. Creating new records on a paste is a much less common convention. (I imagine there are some database programs (Access?) that create new records on paste, but I don't know any offhand.)

    It's true that otherwise Cmd-V is doing nothing. But given that it would be creating new records in your library, I'm not sure it's a bad thing for this to be a more explicit, specialized action (particularly in Firefox, where Cmd-V is a valid shortcut key in Firefox itself and the action would have to depend on which pane had focus). I don't have particularly strong feelings on this, but I don't think it's as clear-cut as you're making it sound.
  • What happens when you paste in a spreadsheet?
    The rows are comparable to records (visually and semantically), and they get pasted just fine.

    You paste one or more items, and what an item is is defined by the nature of the document. In a word processor, it'll be letters or words or images, in a UI builder it's typically an object (an anything that is an instance of a UI class), and here it's a reference for a paper. I'd find anything else strange.

    It's also consistent with other interaction. You can drag&drop whole records, right? When you hit "delete", do they get deleted?

    As for Firefox - I am talking about the standalone program. As a user, the roots of Zotero mean nothing to me :)
Sign In or Register to comment.