ZotFile - Advanced PDF management for Zotero
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
This discussion has been closed.
I noticed a problem when there are two attachments with one which is not of the specified format (pdf, doc, rtf, ...). In that case, nothing happens. I think the pdf file, for instance, should be processed. It is if the other attachment is deleted first.
I will look how it would be possible to "merge" Zoterename functions into Zotfile, i.e. the ability to auto-execute Zotefile's renaming function whenever a file is attached during the creation of a reference.
Thierry
current code
// for (var j=0; j < attachments.length; j++) {
var j=0;
if (attachments.length==1) {
changed code
for (var j=0; j < attachments.length; j++) {
// var j=0;
// if (attachments.length==1) {
Let me know what you find out about automatically renaming any newly added files. I guess the easiest way would be to add an eventlistener which calls RenameAttachments whenever an attachment is added.
Has anyone else played with the updated version?
kithairon
How I can make the zotfile options in the right click menu only appear for certain item types?
Have a look at showRenameMenu in zoterename.js for this question in particular.
Edit:
The file "overlay.xul" should give you a sketch of solution to your other question:
How to add the zotfile functions to zotero's paperclip drop-down menu?
By the way, the file "options.xul" gives the way to make preferences easily accessible.
Edit 2:
I think that the duplication of options in the context-menu comes from the function
createUI
. In fact, when I commentthis.createUI()
, they appear only once. I do not completely understand for the moment how overlays are working, but it seems that it is loaded twice. By the way, what ismergeObserver
doing?ps: Thanks Thierry. Unfortunately, I wasn't able to add zotfile to the attachment drop-down menu because I think it doesn't has an id so that I can't add anything to it...
I did have to edit the file type regex to add support for JPG -- it would be nice if images were supported by default, or if the list of types could be set in about:config. If you do add JPG, consider adding DjVu as well -- it has a decent following in Russia and probably some other parts of the world.
I'm also exploring the possibility of calling an external program to pre-process the files -- I'll let you know if and when I have working code to add such a feature.
I haven't put in the time to polish off the feature, but the idea is that I add a new menu entry to "Convert and attach". Zotfile calls an external executable that does something, then pulls in the output if that executable returned the expected exit code. The example Windows batch file on github make DjVu files out of JPEGs.
Issues so far:
-- My call to the external executable is blocking, so Firefox is frozen until the conversion completes. It should be easy to fix this, but I haven't really tried yet.
-- The item attachment logic I'm using isn't flexible about file types-- the file extension consumed and produced by the external script should at least be defined by preferences and not hard-coded.
-- I would like to add an option to disable renaming altogether; that'll happen later
-- The work farmed out to the batch script could easily be done from within Firefox-- we could call conversion utilities right from Firefox just as well
-- I hadn't written a Windows batch file for at around a decade and I plan to rewrite at least that part of it once I fix my wireless under Linux and move back to its more familiar confines.
-- Multipage documents should be batched together into single DejaVu files.
Anyway, I imagine that I'm not the only one taking extensive photographs of documents, so I'd appreciate the feedback of any intrepid souls who would like to try this out. I'll make an XPI when I'm back on Linux.
http://www.columbia.edu/~jpl2136/zotfile_150b4.xpi
This should now work with multiple items and some of the reported bugs should be resolved. As I mentioned earlier, it does not seem to be possible to add zotfile to the drop-down menu because I think it doesn't has an id so that I can't add anything to it...
Reports are welcome...
Happy new year!
Thanks for the update!
I have tried it a few days and everything seem to work, though my testing may not encompass every aspect of Zotfile (e.g., I deal only with PDF).
It doesn't matter for the "paper-clip drop-down menu", in my opinion; "one shot" button(s) might be more useful.
I would like to add some suggestions of features if you wish to implement them some day:
- It would be great to enable automatic action (rename-move-link) whenever a file is attached —either through the source folder or through Zotero automatic download of references (see ZoteRename).
- Managing the option through a menu of preferences would be especially useful for the third point (see my preceding message for info).
- It would be wonderful to have a "tool" for the users in order to get different actions or options according to the types of files and/or the collections and/or source directory(ies)...
I should admit that for know, these functionalities may look a bit superfluous with regards to current Zotero's ability with collections (e.g., no intersection of saved searches like in EndNote). However, I would really appreciate to classify my documents at different locations (or hierarchisation) according to their nature.By "tool", I mean the simplest way for both the programmer and the user to manage such functionnalities. I suppose that it may involve the user to code some lines; the aim would be to reduce these by predefined "module" that one can just copy/paste and change the parameters... (for example).
Thanks again!
Thierry
I am interested in automatic actions myself and I might implement it at some point. Can't really say when though - pretty busy right now... I don't think that I will do your other recommendations... sorry for that. You know that it's possible in the new version to put the pdf in different folders based on metadata from the item (e.g. different folder for journals)?
A Bug: I think the plugin still does not work in new Firefox windows (not the one which opens when you start Firefox). I wasn't able to solve the problem even though some people pointed out a solution in this forum. Does anyone know what I need to change specifically?
I will give it a try if I manage to allocate some time for it.
I am not sure I understand your description of the bug you mention: by "new Firefox windows", you mean if one opens a link in a new window? Like with Maj+ clic?
By the way, do you know why there is no icon (in the address bar) to directly insert a reference when a pdf is opened within the browser?
Of course, this has nothing to do with the plug-in, but I wonder if this could be implemented in Zotero... It is obviously useful.
Because there is no readable metadata on the page so a translator can't work - and there is only a URL bar icon when there is a translator.
However, are there no metadata to be extracted from the PDF ? (even bad ones...) There is often no translator on websites where I open PDFs. Therefore, it would be very useful to fetch them directly ; in some sense in the same way as "snapshot of the page".
Or do I miss a tip to do this by another quick way?
I unchecked it because otherwise it creates a useless snapshot of each webpage associated with an article from ScienceDirect or other platform.
Besides, it takes more time than the clic on the icon (opening Zotero takes a while when the number of references are high).
Anyway, that's at least a possibility.
https://addons.mozilla.org/en-US/firefox/addon/zotfile/
The new version supports batch processing of existing attachments, which I think a lot of people find useful (at least there have been frequent request about it). So you can basically change the zotfile renaming rules, select all your zotero items and rename all the attachment using data from the respective zotero item by clicking one button (please be careful with this option for now).
Here is a summary of the new features:
- Support for Firefox 4 and Zotero 2.1 (including support of zotero as a tab)
- batch processing of existing attachments (renames and moves all attachments of selected items according to Zofile rules)
- allows the user to organize files into subfolders using zotero metadata
- bug related to multiple zotero windows resolved
- The zotfile icon was replaced by two right-click menu items
Let me know if you have any problems with the new version...
I installed and configured v1.5 as per the instructions but I cannot find any new menu items to actually use Zotfile. Am I missing something? I am on Win7 64bit, FF 3.6.13, Zotero 2.0.9
Also, since you now allow users to organize files into subfolders based on metadata, would it be possible to use collection names in the rules? I know this would be quite a challenge with nested subcollections and you would have to pick a single collection if an iteam appears in more than one.
fbennett, are you using the 2.1beta or 2.0?
Lubos, I am trying to figure out whether the current version only works with the Zotero 2.1beta. I had to made a change for the Zotero as a tab feature and now I am afraid that zotfile does not work with zotero 2.0 anymore. Can you try this version and tell me whether you can see the menu items when you right click a zotero item:
http://www.columbia.edu/~jpl2136/zotfile_150_test.xpi
Thanks for the great plugin, this makes Zotero much much more usable!
http://www.columbia.edu/~jpl2136/zotfile_150_test.xpi
again? I am trying to make it work for both 2.0 and 2.1...
https://addons.mozilla.org/en-US/firefox/addon/zotfile/
Here are the changes again:
The new version supports batch processing of existing attachments, which I think a lot of people find useful (at least there have been frequent request about it). So you can basically change the zotfile renaming rules, select all your zotero items and rename all the attachment using data from the respective zotero item by clicking one button (please be careful with this option for now).
Here is a summary of the new features:
- Support for Firefox 4 and Zotero 2.1 (including support of zotero as a tab)
- batch processing of existing attachments (renames and moves all attachments of selected items according to Zofile rules)
- allows the user to organize files into subfolders using zotero metadata
- bug related to multiple zotero windows resolved
- The zotfile icon was replaced by two right-click menu items