A way to store annotations of multiple documents to the files at once

I am using Zotero beta and having an integrated way to read documents is awesome. I also use ZotFile to extract notes from the annotations but I need to manually store the annotations into the files so that ZotFile can find them.

Can you please provide a way to store annotations into multiple files at once? It'd be much better if storing annotations into files is done automatically without the need to do it
  • If you're using the new PDF reader, you don't need to use ZotFile to extract annotations.

  • This is a really nice feature.
    Thanks for the pointer. However, I would still like to add notes to multiple documents from their respective annotations at once without the need to go through each document's parent item.
  • So basically you just want "Add Note from Annotations" to appear in the items list context menu when multiple items with annotations are selected? We can probably do that.
  • Yes, that's what I am looking for.
    And it would be nice to have another feature where generating a note using annotations would delete an older note that was generated from older annotations.
  • edited December 16, 2021
    I've added the ability to create notes from multiple items in the latest beta.

    The ability to update an existing annotation note rather than creating a new one is planned (but it's tricky, because you might have modified the existing one, added other text, etc.).

  • I don't know if it is better to start with a request or the problem to which the request is a possible solution. This time I'll start with the goal.

    My aim is to select multiple items and add a single note for each item. Simply a batch repetition of the regular "Add Note from Annotations" menu item.

    I love the feature that allows a user to add a note from annotations, fully integrated with my Zotero library. Amazing. However, I've got a lot of entries with PDF files that are annotated (and many files which are not annotated). Looking at my library there is no way to know which entries have annotated files and which do not. At present I seem to have two options. First, wade through each individual entry and select "Add Note from Annotations." If there are annotations, a note is created and I'm all set. If there are not annotations, no note. But that is a lot of multi-step clicking on every single item. Second, I can select multiple items and select "Create Note from Annotations" which creates one note from any/all the annotations of all the files. This note is no longer situated as part of the individual item within the Zotero library.

    If there is no way to create that functionality then I'm wondering if as a marginal improvement it would be possible to add keystroke shortcuts for the "Add Note from Annotations" menu item. Not a perfect solution but at least it would speed things up. Zutilo doesn't seem to have that option (and I know it is a third party plugin you don't manage).

    Thanks for any help you might be able to provide. I promise not to spend my whole sabbatical peppering you with questions...
  • edited January 19, 2023
    @jcutlerweb: Yeah, since the discussion above, "Create Note from Annotations" took the place of "Add Note from Annotations" for multiple items, and we no longer expose the ability to create multiple child notes for multiple selected items. The code is still there, though. Select multiple items (which can include items without annotations), go to Tools → Developer → Run JavaScript, and run this:
    return await ZoteroPane.addNotesFromAnnotationsFromSelected()
    This will create a child note under each selected item for each child attachment with annotations.

    (Always a good idea to make a backup of zotero.sqlite in your Zotero data directory and temporarily disable auto-sync before running anything there.)

    If there's sufficient demand, we can consider bringing back a way to trigger this from the UI, but generally I think the better solution is just to show which top-level items and attachments have annotations, which obviously we need to add and which will make it easier to trigger "Add Note from Annotations" on just the items that require it.
  • @dstillman: thank you so much for the quick and helpful reply! I'm delighted that the code is still there. I doubt I represent any significant demand but I appreciate your flexibility. I also think your proposed solutions about visibility and triggering would be terrific.

    you're the best!
  • @dstillman: the code above works but generates two annotation notes instead of one. any fix ideas?

    (anticipating one explanation i offer the following: these are not duplicates of previously created notes. i used a saved search you described elsewhere in the forum to delete all notes in the library prior to running the code. also, the duplicate annotation notes have the exact same time stamp)

    everything is backed up as you suggested so this is none of this is a crisis.
  • It should only generate two if the parent items are expanded and you're selecting the child attachments as well as the parent items. You can press "-" to collapse all items in order to only select the parent items.
  • @dstillman: Aye on bringing the function to create separate notes for each child entry back. A combined note is good for looking through the literature at once. But separate notes help allocate the specific entry easier and efficiently!
  • i've previously had success running the javascript code you provided

    return await ZoteroPane.addNotesFromAnnotationsFromSelected()

    I'm getting an error message:
    TypeError: right-hand side of 'in' should be an object, got boolean

    Is the code still there?
  • @jcutlerweb: Still there. This is with any item, or a specific one? Can you provide a Debug ID for triggering the error?
  • Debug ID

    It works for some items and not for others and I cannot figure out the distinguishing variable in the different items.
  • edited April 30, 2023
    (3)(+0000037): Importing annotations for item 1/H32CTVHL

    (2)(+0000010): Attachment file '/Users/[…]/Library/Mobile Documents/com~apple~CloudDocs/Zotero/[…].pdf' not found
    @jcutlerweb: It's linked files being stored in iCloud that macOS has evicted from your computer. Zotero tries to trigger a download for those when you open them normally, but it doesn't currently do that when creating a note from annotations. We'll look into fixing that, but for now if you open the file first it should work.
Sign In or Register to comment.