How to copy (several) PDF in library to File Manager

Firefox 11/Linux Fedora 15/Zotero 3.0.3

There is a neat feature to save a PDF from (e.g.) Google search, to Zotero. I saved a bunch of PDF to my library. I need to copy them in my file manager.

I tried to Ctrl+a the PDF in the library, and to drag them in a directory of my file server. That's not working.

"Export" is not what I am looking for. "Show file" shows me the PDF in its cache directory.

How? Thanks
«1
  • The answer depends on what are you trying to accomplish by exporting these items. Please be more specific about the use case.

    In general, you can do "Show file" and then copy-paste each file where you want. But there are also other alternatives such as ZotFile, or shell scripts, or searching the local file system etc.
  • File drag-and-drop straight from the Zotero pane doesn't work on Linux.

    If you just want all PDFs, just do a search in your file manager for all PDFs within the Zotero data directory.
  • I want to know if I can easily copy documents in my Zotero library to my file manager, from the Zotero GUI.

    I now collected 10 PDF. They are in my library. How can I copy & past them (or drag them) all at once in my file manager? Can I even do it?

    "Show file" will open 10 windows of my file manager. That's not fine.
    --
    ZotFile looks great for batch renaming, thanks for the pointer, but I am not sure I can "mouse select" several documents at once, and copy them to my file manager?
  • What problem are you trying to solve by showing 10 files in the file manager?
  • [Dan Stillman]
    File drag-and-drop straight from the Zotero pane doesn't work on Linux.

    Thank you. Is there a plan to make it work a way or another?
  • this has been broken for a while and as I understand is due to a bug in linux and/or mozilla's linux integration so it likely won't get fixed anytime soon, no.

    What Dan and mronkko are suggesting is that if you will need to do this frequently you should look into a way to have those pdfs handy outside Zotero - since pdfs are typically renamend in a straightforward fashion, having a saved search/virtual folder with all pdfs is actually a pretty quick option for that.
  • thank you for the comment, but I am not sure if explain, or understand dan & mronkko correctly.

    The PDF files I download through Zotero go to a sub-directories of "/storage/" eg. "MUHCXSN6", "QQD8CK6H"

    My only problem: I want to save some of these PDF to a location on my file manager, either weekly or monthly.

    I used to tag them as "PDF"; following your (their) suggestion, I created a virtual search directory. I can see all the PDF at once, but since I can't drag and drop them on my file manager, because of the bug, the files are still spread in several sub-directories of /storage/.

    The only way I see (as mronkko suggested) is to $ find & copy recursively in /storage/, and to make a script of the command.

    Is that correct?

    What do you mean by: "since pdfs are typically renamend in a straightforward fashion" That's a user action, or some automatic renaming feature in Zotero?
  • I used to tag them as "PDF"; following your (their) suggestion, I created a virtual search directory. I can see all the PDF at once, but since I can't drag and drop them on my file manager, because of the bug
    No, we're saying to create a virtual search in your file manager for PDFs within that directory, not in Zotero itself.
  • "since pdfs are typically renamend in a straightforward fashion" That's a user action, or some automatic renaming feature in Zotero?
    Both. Files saved via translators are renamed automatically. Files that you add manually can be renamed from their parent items' metadata via the context menu.
  • edited April 27, 2012
    Well, thanks again for all your answers along my first steps using Zotero.

    A. I finally get it. But I don't think a virtual search feature exists on the light-way file managers I use (LXDE & XFE desktops), anyway, I will ask.

    B. Renaming via translators and context menu: good to know.

    C. How do you quote me? I use Format comments as Text. When I switch to Html, [I don't see a change] edit: it revert back to text.
  • How do you quote me?
    <blockquote> in HTML mode
  • The original poster may find this useful: I wrote a python script for myself that keeps all my zotero-managed PDFs in a single directory with no sub-folders, so that I can easily sync them with my android tablet. You can download it here:
    http://students.washington.edu/drmccloy/resources/zoteroPDFsLinker.py

    You'll need to change line 6 to match where your Zotero storage folder actually is, and line 8 to where you want the PDF "copies" to live. I put "copies" in quotes because currently it's set up to create hard links rather than copies, and there is an option in the code somewhere around line 34 to switch that to symlinks instead of hard links... but it doesn't make true copies precisely because I wrote this to prevent wasting disk space. Note that the script is not smart enough to handle file name conflicts, and depending on how long Zotero is set to keep items in the trash, it may take a while for PDFs removed from Zotero to actually disappear from the output folder.

    The script probably only works on Linux since it uses the os.link() function, and has been tested with Python 2.6. It comes with the standard disclaimer: no warranty (express or implied), use at your own risk, may damage your system, etc etc etc.

    Personally, I have a little shell script set up to run this every time I shut down the computer, but you can of course run it manually from the command line too.
  • The original poster may find this useful
    I do. Thank you for sharing your python script, and to explain how to use it. I will look at rsync man page to include the hardlinks in my backup.

    If you don't mind, I would like to see your shell script.
  • If you are interested in scripts to "export" items stored in Zotero, here is another one

    https://github.com/mronkko/BuildFolderStructureForZoteroItems
  • I am, thank you.

    I changed with my parameters :
    l5. my $zoterostorage="/home/mt/.mozilla/firefox/h8e4kdp1.default/zotero/storage";
    l6. my $target="home/nm/zotero";

    l8. my $dbh = DBI->connect("dbi:SQLite:dbname=$zoterostorage/zotero.sqlite","",""); [do I need to change zoterostrage to zotero?]

    I get this message when I run the perl script:

    [mt@nh28d bin]$ mronkko_zotero.pl
    Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at /home/mt/bin/mronkko_zotero.pl line 3.
    BEGIN failed--compilation aborted at /home/mt/bin/mronkko_zotero.pl line 3.
    [mt@nh28d bin]$
  • the shell script for running at shutdown is about as simple as they come:

    #! /bin/bash
    python /path/to/wherever/you/put/the/python/script/zoteroPDFsLinker.py

    Put the shell script wherever you want, then make a symbolic link to it in the folder /etc/rc0.d/, and name the link something like "K99zotero" (the K99 part controls the order it gets executed with respect to other shutdown scripts)
  • (alternatively you can run this as a Cron job).

  • Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at /home/mt/bin/mronkko_zotero.pl line 3.
    BEGIN failed--compilation aborted at /home/mt/bin/mronkko_zotero.pl line 3.
    [mt@nh28d bin]$
    You need to install the package that provides DBI

    http://www.google.com/search?q="Can't locate DBI.pm"
  • Put the shell script wherever you want, then make a symbolic link to it in the folder /etc/rc0.d/, and name the link something like "K99zotero" (the K99 part controls the order it gets executed with respect to other shutdown scripts)
    Thanks drmccloy. I will try it. it easier than setting a con job for me.

    I will also ask about mronkkro perl script, on a script forum, when I have time.
  • con job or cron job?
  • cross post.

    I have installed perl-DBI.

    Installed Packages
    Name : perl-DBI
    Arch : i686
    Version : 1.616
    Release : 3.fc15
    Size : 1.9 M
    Repo : installed
    From repo : fedora
    Summary : A database access API for perl
    URL : http://dbi.perl.org/
    License : GPL+ or Artistic
    Description : DBI is a database access Application Programming Interface (API) for
    : the Perl Language. The DBI API Specification defines a set of
    : functions, variables and conventions that provide a consistent
    : database interface independent of the actual database being used.

    I still fail running the script.

    [mt@nh28d bin]$ perl mronkko_zotero2.pl
    install_driver(SQLite) failed: Can't locate DBD/SQLite.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at (eval 3) line 3.
    Perhaps the DBD::SQLite perl module hasn't been fully installed,
    or perhaps the capitalisation of 'SQLite' isn't right.
    Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge.
    at mronkko_zotero2.pl line 8

    I grep the list of packages with DBI.

    [mt@nh28d bin]$ yum list |grep DBI
    perl-DBI.i686 1.616-3.fc15 @fedora
    R-DBI.noarch 0.2.5-3.fc15 updates
    perl-Apache-DBI.noarch 1.10-2.fc15 fedora
    perl-Apache-DBI-Cache.noarch 0.08-9.fc15 fedora
    perl-CGI-Application-Plugin-DBIC-Schema.noarch
    perl-CGI-Application-Plugin-DBIProfile.noarch
    perl-CGI-Application-Plugin-DBIx-Class.noarch
    perl-Catalyst-Authentication-Store-DBIx-Class.noarch
    perl-Catalyst-Model-DBIC-Schema.noarch 0.40-5.fc15 fedora
    perl-Catalyst-Model-DBIC-Schema-tests.noarch
    perl-Catalyst-Plugin-Session-Store-DBIC.noarch
    perl-Class-DBI.noarch 3.0.17-9.fc15 fedora
    perl-Class-DBI-AbstractSearch.noarch 0.07-11.fc15 fedora
    perl-Class-DBI-AsForm.noarch 2.42-11.fc14 fedora
    perl-Class-DBI-FromCGI.noarch 1.00-10.fc15 fedora
    perl-Class-DBI-Loader.noarch 0.34-8.fc15 fedora
    perl-Class-DBI-Loader-Relationship.noarch 1.3-14.fc15 fedora
    perl-Class-DBI-Pager.noarch 0.08-10.fc15 fedora
    perl-Class-DBI-Pg.noarch 0.09-11.fc15 fedora
    perl-Class-DBI-Plugin.noarch 0.03-13.fc15 fedora
    perl-Class-DBI-Plugin-DeepAbstractSearch.noarch
    perl-Class-DBI-Plugin-RetrieveAll.noarch 1.04-10.fc15 fedora
    perl-Class-DBI-Plugin-Type.noarch 0.02-13.fc15 fedora
    perl-Class-DBI-SQLite.noarch 0.11-11.fc15 fedora
    perl-Class-DBI-mysql.noarch 1.00-11.fc15 fedora
    perl-DBI-Dumper.i686 2.01-13.fc15 fedora
    perl-DBICx-TestDatabase.noarch 0.02-6.fc15 fedora
    perl-DBICx-TestDatabase-tests.noarch 0.02-6.fc15 fedora
    perl-DBIx-Class.noarch 0.08127-2.fc15 fedora
    perl-DBIx-Class-Cursor-Cached.noarch 1.001001-1.fc15 updates
    perl-DBIx-Class-DateTime-Epoch.noarch 0.07-1.fc15 fedora
    perl-DBIx-Class-DateTime-Epoch-tests.noarch 0.07-1.fc15 fedora
    perl-DBIx-Class-DynamicDefault.noarch 0.04-1.fc15 updates
    perl-DBIx-Class-EncodedColumn.noarch 0.00010-4.fc15 fedora
    perl-DBIx-Class-IntrospectableM2M.noarch 0.001001-1.fc15 updates
    perl-DBIx-Class-Schema-Loader.noarch 0.07010-1.fc15 fedora
    perl-DBIx-Class-Schema-Loader-tests.noarch 0.07010-1.fc15 fedora
    perl-DBIx-Class-TimeStamp.noarch 0.14-3.fc15 fedora
    perl-DBIx-Class-tests.noarch 0.08127-2.fc15 fedora
    perl-DBIx-ContextualFetch.noarch 1.03-12.fc15 fedora
    perl-DBIx-DBSchema.noarch 0.40-1.fc15 updates
    perl-DBIx-POS.noarch 0.03-11.fc15 fedora
    perl-DBIx-Safe.noarch 1.2.5-12.fc15 fedora
    perl-DBIx-SearchBuilder.noarch 1.62-1.fc15 updates
    perl-DBIx-Simple.noarch 1.35-2.fc15 fedora
    perl-DateTime-Format-DBI.noarch 0.032-7.fc15 fedora
    perl-HTML-FormFu-Model-DBIC.noarch 0.08002-3.fc15 fedora
    perl-HTML-FormFu-Model-DBIC-tests.noarch 0.08002-3.fc15 fedora
    perl-Ima-DBI.noarch 0.35-11.fc15 fedora
    perl-POE-Component-DBIAgent.noarch 0.26-9.fc15 fedora
    perl-POE-Component-SimpleDBI.noarch 1.27-6.fc15 fedora
    perl-Tie-DBI.noarch 1.05-3.fc15 fedora
    perl-XML-Generator-DBI.noarch 1.00-11.fc15 fedora

    It's probably there under a different name. I should probably ask on my distribution forum. I don't have much expertise.
  • edited April 29, 2012
    nomnex: Sorry, but as you say, this isn't the place for general Linux questions. (Read the error message, though. It tells you the problem.)
  • Sure, sorry about that.
  • Hi,

    As suggested in this post, I am trying to run the script by mronkko to "export" items stored in Zotero: https://github.com/mronkko/BuildFolderStructureForZoteroItems

    Since all of you already discussed this, I would appreciate any tip/workaround for the problem I am facing, which discussion has started in another Zotero's post today:

    https://forums.zotero.org/discussion/36120/zotero-collection--subcollections-as-searchable-folders-hierarchies-in-windowsn/

    Thanks in advance,
    Cadu
  • (as per above, general issues with running perl scripts are probably better asked in a perl forum and/or on stack overflow)
  • I was wondering if I could open an issue on GitHub about this problem. Specifically:
    "PDF drag and drop / copy and paste from Zotero to other apps is broken on Linux"
    (Please correct the wording if necessary)

    As this is a regression, according to adamsmith's 26th of April 2012 comment, I thought it should appear on GitHub to attract some attention.
    this has been broken for a while and as I understand is due to a bug in linux and/or mozilla's linux integration so it likely won't get fixed anytime soon, no.
    Even though it seems to be a problem with Linux or Firefox, I can not find any details about it, and continuing the discussion on GitHub would allow us to centralise information relevant to developpers about this issue.

    Does anyone know of a bug reported for Linux or Firefox? Or any other thread in Zotero's forums?

    Just for the record, before understanding the rules of issue reporting on GitHub, that was my attempt at reporting it: https://github.com/zotero/zotero/issues/491

    Cheers
  • Haven't found a bug report for Firefox (drag'n'drop _to_ FF bug reports exist, just not _from_, since there's probably not much of that going on), but a similar bug has been outstanding in Thunderbird for over 7 years now: https://bugzilla.mozilla.org/show_bug.cgi?id=377621 and https://bugs.launchpad.net/ubuntu/+source/thunderbird/+bug/381017
  • You can't drag from the Firefox downloads window on Ubuntu either, which is usually the test for these sorts of things, but this patch claims to fix file drag on KDE, at least. Anyway, no need for any new issues on GitHub. I'll try to review that patch soon.
  • You can't drag from the Firefox downloads window on Ubuntu either, which is usually the test for these sorts of things
    Can you on OS X? It's not working on Windows as well (not that I'm surprised) and it doesn't seem like drag-dropping is implemented at all in the downloads window (i.e. I don't get any drag effect)
Sign In or Register to comment.