Coder Social home page Coder Social logo

wileyyugioh / zotmoov Goto Github PK

View Code? Open in Web Editor NEW
273.0 5.0 6.0 6.55 MB

Zotero plugin to automatically move attachments and link them

License: GNU General Public License v3.0

Fluent 3.44% JavaScript 84.98% HTML 6.33% PowerShell 0.26% Python 4.99%
zotero zotero-plugin

zotmoov's Introduction

ZotMoov

A simple plugin for managing attachments in Zotero 7

ZotMoov can:

  • Automatically move/copy imported attachments into a custom directory
  • Manually move/copy imported attachments into a custom directory via right-clicking
  • Automatically delete linked attachments from your computer when you delete them in Zotero

Installation

Download the latest release here

  • If using Firefox you have to right click the .xpi and save link as.

To set up with 3rd party syncing services, set the Linked Attachment Base Directory to the synced folder.

Then point ZotMoov to that same folder.

It is highly recommended to

  1. Make a local backup before mooving your library
  2. Give ZotMoov its own folder that other applications will not alter
  3. Uncheck "Sync attachment files in My Library" in the Sync settings if you do not plan to use Zotero's cloud file storage

FAQ

File Renaming

I recommend using the automatic file renaming functionality included in Zotero 7. It has support for custom patterns.

Moving Files in Group Libraries

Zotero does not support linked files for group libraries, so ZotMoov can only move files in your personal library. Any linked files pointing to group libraries that are somehow created will be broken. The copy feature is unaffected by this limitation.

Bugs/Feature Requests

Both can be filed here. Please keep feature requests tightly focused on the extension's core purpose of mooving attachments and linking them!

Settings

Directory to Move Files To

The base directory where ZotMoov will move/copy files

File Behavior

By default ZotMoov will move and link your files. You can change the dropdown menu option to copy for ZotMoov to just make a back-up of your added files in the specified directory.

Automatically Move/Copy Files When Added

When this is enabled, ZotMoov will automatically move/copy files whenever they are imported into Zotero. The types of files can be restricted by the Allowed File Extensions option.

Automatically Move/Copy Files to Subdirectory

When this is enabled, ZotMoov will automatically move files into a custom subdirectory whenever

  • a file is moved/copied via Automatically Move/Copy Files When Added
  • the Move/Copy Selected to Directory menu option is used

By default the subdirectory string is {%c} which is by item collection. Click here for the formatting options

Automatically Delete External Linked Files in the ZotMoov Directory

When this is enabled, ZotMoov will automatically delete linked files in the ZotMoov directory. Meaning that when you permanently delete a linked file in Zotero, and that linked file points to a file in the ZotMoov directory, the file on your hard drive will be deleted. It will also delete any empty directories within the ZotMoov directory.

Allowed File Extensions

By adding/removing entries to this table via the [+] and [-] buttons, you can choose which types of files ZotMoov will automatically move via Automatically Move/Copy Files When Added. If the table is empty, then all files will be moved regardless of their file extension. This setting is not used for files moved via Move Selected to Directory menu option.

zotmoov's People

Contributors

redleafnew avatar wileyyugioh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

zotmoov's Issues

Select which type of attachment to store

Zotmoov works great. However, there is uncertainty about which attachments are stored and which are not. And I think I would only like to have PDFs stored outside of Zotero.

The background is that the Zotero parent item can hold notes and other files with additional information. Some entries only have snapshots (HTML).

Zotmoov does not seem to export and link the notes, but it exports and links HTML files and snapshots besides PDFs. I would like to have these in Zotero; only PDFs that follow the naming convention for PDFs in Zotero should be exported.

Also, I think epubs can be read in Zotero now; I am not yet bothered about them, but they might be treated like PDFs as well.

adding batch move function

希望作者可以添加batch move的功能. 目前虽然可以使用batch move点击操作, 但似乎无法真正执行. 只有移动单个文件的时候, 文件移动才会真正执行.

zotmoove.js PathUtils error

Not sure how to use github to report this, but on line 95 of zotmoove.js it says:

clone.setField('title', PathUtils.filename(clone.attachmentPath));
However, I believe it should be

clone.setField('title', PathUtils.filename(final_path));
because final_path is a full path that PathUtils can work with, but clone.attachmentPath is not. Move was not working for me until I made this change for myself.

能不能像zofile那样监视文件夹及复制到zotero,而不是链接

如图,
1、直接监视文件夹,下载的文件一键添加附件或链接附件

image

image

2、选择是链接文件还是复制到zotero数据储存目录里面,如图

第一个是复制到zoter数据储存目录里面,复制到zotero里面用于Web DAV同步。
红色的下面的那是链接到文件夹,用不了web DAV同步。

image

谢谢!!

move the pdf attachments and link them

would you add a feature that can move the pdf attachments to the "folder" and link them.
the feature will allow exporting attachments of items in the Zotero Library or selected collection as files organized in "folders". The exported attachments (files) will be organized in "folders" which reflect the hierarchical structure of the selected Zotero Library/Collections.
For example, a reference is in "My Library/A/B", and "move the pdf attachments and link them" will move the PDF to "zotero home directory/A/B" folder, and link it.

this maybe is helpful. https://github.com/retorquere/zotero-file-hierarchy

thank you

Create custom subfolders

One of the more useful features Zotfile offers for large PDF libraries is the ability to sort files into alphabetic subfolders. The collections option within Zotero doesn't exactly accomplish this and, as noted, runs the risk of creating duplicate locations. Would it be possible to get something similar with this plugin?

html attachments (snapshots) cannot be re-converted to stored files

When marking multiple entries to create linked files from stored files, snapshots (HTML) are also exported and linked.

(1) When testing zotmoov, after linking files of entries, I used the Tools > Manage Attachments > Convert Linked Files to Stored Files command, which works well with PDFs and restores them in Zotero storage. However, snapshots (HTML files of a web page) are restored in a first step but immediately re-linked with file name addition 1. I have to stop Zotmoov, manually return the file, and rename it to get snapshots back.

(2) When linking snapshots, Zotero cannot check that they are snapshots (and cannot give them their icon), so I never get the snapshot icon back for these items.

(3) I would rather have snapshots kept in Zotero storage than linked together with PDFs. My last issue (#16) is with the above behavior in mind.

Thank you very much for your work!

[FR] Move to the subfolder relative to the root path

Thanks for this life-saving plugin when the ZotFile/Zotero-File is not available in Zotero 7.

I am thinking if you have time to implement the following behavior like ZotFile does:
Move the PDF attachment into the subfolder relative to the root path specified in the settings.

图片

For example, I set the location for the PDF files as /pdf/root/path in the settings of this plugin, and I have one item added in the Course-ELEC5110 subfolder in Zotero. Both ZotFile and Zotero-File can move the PDF file into /pdf/root/path/Course-ELEC5110. However, this plugin moves the PDF file into /pdf/root/path instead.

Thank you.

new function: customized file saving path

Hi, I am not sure whether following function can be added:

add another move option to the right click manual:
- allows user to choose the folder where he wants to store the file.

Note: I understand that this option exists in the setting window, but adding this to the right click manual make it more intuitive when saving files, especially when he wants to save some files to some special pathes. (if the workload is high, then just ignore this suggestion.)

image

插件与同步功能存在冲突

Zotero7最新版,插件最新beta版,设置为“新增时自动移动附件”并且File behavior 设置为MOVE,当新增一个Stored Files(此时软件开始将该文件上传到zotero服务器),同时,插件将Stored Files移动到靶目录并修改为Linked Files。于是本地和云端形成冲突,会跳出一个对话框问你保存本地还是云端。。
经过测试,先关闭软件自动同步功能,再添加文件,等插件移动完了再开启同步就不会有冲突问题,但这样就非常不方便,一旦添加很多文件,后面忘了开同步就会漏同步,建议插件增加一个移动前自动暂停同步,移动后再开启自动同步的功能,谢谢!

Automatically move new files

I am not sure if it already exists, I can't find it... Maybe I am just blind.

It would be nice if the files would automatically be moved instead of having to do it manually, just like Zotfile did.

FileNotFoundError (file exists)

This time, a real issue...

I am getting a lot of these:
image

The file does exist in the path, as is visible here:
image

Manually copying the pdf to the specified location does work. For some reason, other files do work when moving. (PS, my target is a mapped network drive from my Synology NAS)

不错的插件

正好需要,有一个zotero插件开发团队微信群,茉莉花的作者也在里面,有兴趣加入吗?

pdf is not moved automatically

When saving link from the chrome connector, the associated pdf is not moved to the destination folder automatically.

Also, when I mannually move, the link name is not set to the same as the file name (after auto renaming).

Request: Wildcard for year added on zotero

Great extension! However, I am currently missing a (for me) quite useful wildcard.

I would like to move the attachments to a specific directory and use zotmoov to organise the attachments based on the year I added them on Zotero. In the ZotMoov Wildcard Formatting I could not find such option (only publication year %y ) and I was wondering if it would be possible to add such feature

Request: Full date wildcard

Add a full date wildcard. The behavior would be to use the full date if available, falling back to yyyy-mm or yyyy if not. I could take a stab at this and submit a pull request. Since %D and %d are already used, my suggestion is %g (for Gregorian, the best I could come up with).

I work with newspaper clippings and I'd like my directory structure to include the full date of publication. I'm currently using year ({%c}/{%y} - {%t}) which is okay but I'd prefer the complete date.

edit: I neglected to mention how much I appreciate this plug-in. It's saved me hours of work and kept me organized. Thanks!

Request: Subdirectory setting for moving files manually

Hello,

Thank you for building this extension. It is proving to be very helpful.

When I decide to read a paper, I want to be able to move it into a subdirectory called "Reading". At the moment, when I right-click on the PDF file and select "Move to selected custom directory", a pop-up window appears so that I can choose a directory. But this will get tedious if I have lots of files to move. I would like to be able to set the directory name in the settings, and just select a menu item to move to that directory.

I have tried putting the directory name into the "Automatically move/copy files to subdirectory" setting, but I have that setting turned off because I don't want the files to be moved there automatically. And it doesn't seem to pick up the directory name I have entered when the setting is turned off.

Is this making any sense?
Also, thank you for writing this extension. :D

zotmoov on group libraries?

Zotmoov works efficiently on personal libraries (default My Library on Zotero), but I cannot manage to move files automatically for group libraries. Is this a known missing functionality?

Thanks a lot

Subfolder named with citation key not updated according to changes in Zotero

I tested creating subfolders with the name of the citation key and observed the following:

  1. When I change the citation key in Zotero, the subfolder name is not updated.
  2. When unlinking the file (convert to stored file again), the folder stays, though empty when the file is deleted by zotmoov.

--> I imagine that other subfolder naming conventions will also not reflect the changes in Zotero, making the system somewhat unreliable.

--> zotmoov follows the renaming of linked files (if renamed in Zotero, the linked file -- HTML and PDF -- is also updated. So this is reliable.

For the time being, it seems best to work without subfolders and manually link files individually to keep snapshots alive in Zotero.

Thanks!

Subfolder not deleted after unlinking files and deleting them with zotmoov

When converting a linked file back to Zotero and deleting the file in the external folder as well, the subfolder is not deleted and stays empty in the folder for linked files.

--> When converting a linked file to a file stored in Zotero, deleting the originally linked file in a subfolder, the subfolder should be deleted as well if empty.

Thank you!

Add "Get from Tablet" equivalent feature

Thanks for your work on this extension! 😄

Zotfile had a "Get from Tablet" feature that would copy attachments out of the syncing folder and back into internal Zotero storage. Is that something you'd be interested in adding here?

For some context on my usage model, I used to use Zotfile's "Send to Tablet" to move attachments I wanted to read on my tablet to a shared syncing folder. I would then read / annotate on my tablet, then move back to Zotero internal storage when done with that item. Zotmoov's copy mode seems to be roughly the same as "Send to Tablet", so that covers the first half of my workflow. As far as I can tell though, there doesn't seem to be any "copy from shared storage back to Zotero internal and remove from shared storage" feature currently, so that's why I've filed this issue.

If you're not interested in supporting such a mode, that's okay of course, just let me know! 🙂 I may fork this add-on or create my own to support it if needed.

彻底删除附件后,在文件夹中pdf文件仍然保留

当彻底删除文件(回收站中永久删除)后,附件仍然保留在链接的文件夹中,日积月累zotero中看不到“死链”文件会越来越多,建议回收站中彻底删除后,文件夹中对应的文件和目录也彻底删除,谢谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.