How to copy the file name of an attachment?

edited October 16, 2020
I need a way to copy the names of PDF file attachments. I've looked through menus and Zotfile and Zutilo preferences but can't seem to find a command that would let me do that. Even clicking on an attachment in Zotero does not seem to provide a way to copy the file name.

Is there a command or keyboard shortcut to copy the file name of an attachment?

I'm using Zotero on macOS, with Zutilo and Zotfile in case that makes a difference.

If there is a solution using AppleScript or other programmatic access, that would be fine – I can work with that.
  • You can select the attachment item in the items list, then highlight and copy the file name from the right pane.
  • edited October 16, 2020
    @bwiernik Thanks for the suggestion. This does not work in my copy of Zotero. When I click on the attachment, and click on the item name in the panel on the right, I immediately get a pop-up dialog to change the file name. I can't seem to highlight the item name without causing that to happen, and I can't highlight the "Filename" field value at all.

    While I could copy the name from the pop-up dialog, doing it that way is problematic for automating something in a workflow. I'm looking for either a keyboard shortcut ("copy file name") or a way to do it from a scripting language, if such a thing is available.
  • I'm not aware of anything -- Zutilo has Show and Copy Attachment Path, both of which include the filename, but that's all I can think of. I think it'd be possible to do in a custom translator, but that'd require some javascript.

    What's the use case?
  • @adamsmith Thank you very much for that tip. I just tried using the Zutilo preferences' Shortcuts panel to assign a shortcut, and it works. Even though the value is a complete path and not ideal for the purpose, I can work with this – I can write some additional code to extract the file name part.

    The use case is the following. I use DEVONthink Pro, and in DEVONthink, index my folder of Zotero attachments. I can open the index window and see a long list of article PDFs in DEVONthink. Now when writing notes _about_ articles, I can use the DEVONthink annotation mechanism, which works within DEVONthink, but as a precaution against losing the connection, I want to save the file name, the citation, and the Zotero item link as metadata.
  • For your consideration: Zotero also has zotero://select links, a custom protocol that links to the item in (Desktop) Zotero. They're in Zutilo as "Copy Zotero select items" link.

    Many people using Zotero with external note-taking apps use these to link notes to Zotero items.
  • @adamsmith That's what I meant by "Zotero item link". Sorry if I used the wrong terminology!
  • oh cool -- I don't think there's clear terminology for these, I just didn't catch that you were aware of them.
  • My bad. I thought the filename was selectable
Sign In or Register to comment.