Need help with identifying linked file attachments that need to be converted to use absolute paths

edited August 9, 2023
Hi, I want to move my linked base directory to another folder. I copied the attachments to the new folder and change the base directory in the setting of Zotero to this new location and got this notification: "163 existing attachments were found within the new base directory. 3 existing attachments within the old base directory will be converted to use absolute paths."

Is there a way to know what these 3 attachments are? I have searched around quite a bit but couldn't find a straightforward way to do it. Thank you!
  • Tools → Developer → Run JavaScript:

    return await Zotero.DB.columnQueryAsync("SELECT path FROM itemAttachments WHERE linkMode=2 AND path NOT LIKE ? AND path NOT LIKE ?", ['attachments:%', 'storage:%'])
  • edited August 10, 2023
    Hi @dstillman, could you please elaborate a bit more on what I can do next with the code? Do I need to put the directory of the new folder anywhere in that code?

    If I just run the code directly without any modification, it returns a list of 30 attachment absolute paths. I went through all these 30 attachments using Zutilo and didn't see anything abnormal. To clarify, I do store some attachments outside of the Base Directory folder, so these are understandably absolute paths.
  • edited August 10, 2023
    That returns a list of all the linked-file attachments in your library with absolute paths. You asked how to find files that still have absolute paths after setting a base directory. That's how. I'm not sure what else you're looking for.
  • @dstillman Oh sorry, I haven't set up the new base directory yet. I stopped when I see the notification that I have 3 files that need to be converted into absolute paths and I was wondering if there's a way to know what these 3 files are before I proceed.
  • The point is that those will be the three absolute paths listed within the old base directory after you change it.
  • Got it. Thanks so much for your help! After choosing the new base directory I can see the items that have absolute paths to the old base directory.
Sign In or Register to comment.