Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zotmoov „Move selected to directory“ does not work for subdirectories #63

Open
apfelpfluecker opened this issue Nov 1, 2024 · 14 comments

Comments

@apfelpfluecker
Copy link

apfelpfluecker commented Nov 1, 2024

If I use Zotero with the Firefox add on and add a full-book via SpringerLink to my library, Zotmoov move the PDF to the correct directory but not into a subdirectory.
That doesn’t work neither automatically nor manually.

Bildschirmfoto vom 2024-11-01 17-47-49
Bildschirmfoto vom 2024-11-01 17-48-52

Zotero: 7.0.8 (Linux)
Zotmoov: 1.1.14

@wileyyugioh
Copy link
Owner

Can you share some info or a screenshot about the parent item? My immediate thought is that it doesn't have the author tag filled out.

@elisaf8
Copy link

elisaf8 commented Nov 22, 2024

Hello, did you happen to solve this issue? It still doesn't work when using even the default %c but possibly it's me doing something wrong.

@wileyyugioh
Copy link
Owner

@elisaf8 can you share some more information? Like a screenshot of the settings page and the item that doesn’t work.

@elisaf8
Copy link

elisaf8 commented Nov 24, 2024

@wileyyugioh Hello, thank you so much for the prompt response. I am attaching a couple pictures about the situation. I read the documentation but I am not the most tech-savvy so I possibly understood it wrongly. What I would like to have is, similarly to a custom directory where the new added files are saved, a tree-like structure where inside my chosen directory the corresponding subdirectories are created depending on where I put new attachments.

I don't know if my request is clear and if the plugin is actually able to do that, but I had found online that with the %c command it should work like that. The problem is, if I add a new attachment in a subcollection with the setting "automatically move to subdirectory" turned on, it doesn't move them. For worse, it does not even save a linked copy of the file I attached (image 3).

I hope my message is clear, and I hope what I am trying to accomplish is possible.

image
image
image

@wileyyugioh
Copy link
Owner

@elisaf8 Does it only not work for the subdirectories? Or for all files? Also, can you tell me the length of your file path? Windows has a limit of 260 characters that has caused problems in the past.

@elisaf8
Copy link

elisaf8 commented Nov 25, 2024

@wileyyugioh it only has issues with subdirectories. My whole directory path is 130 characters long (including spaces), so I doubt it's that one. Considering a long subdirectory name, we get to a maximum of 175 characters. What other issues could there be?

@wileyyugioh
Copy link
Owner

@elisaf8 Can you open up the error console (Tools > Developer > Error Console) and then try and use the menu item to see what errors pop up? It should be in red.

@elisaf8
Copy link

elisaf8 commented Nov 26, 2024

@wileyyugioh sure thing! Here is what pops up. Maybe I have to put the whole directory string before %c to make it work? I have tried it with no success though. Generally, it does not give me that one error if I try again, just the warnings.

image

@wileyyugioh
Copy link
Owner

@elisaf8 I am honestly stumped. Can you try other wildcard tags (maybe %a)? Also is this for every collection or just one in particular.

@elisaf8
Copy link

elisaf8 commented Nov 26, 2024

@wileyyugioh I have tried both with different wildcards and with different collections, doesn't work. It is supposed to create a subfolder named with the desired wildcard, is it right?

@wileyyugioh
Copy link
Owner

wileyyugioh commented Nov 26, 2024

@elisaf8 Yes, that's right. Can you try the following command? Select an attachment in Zotero and then enter the code into the error console.

await Zotero.ZotMoov._getCopyPath(Zotero.getActiveZoteroPane().getSelectedItems()[0], Zotero.Prefs.get('extensions.zotmoov.dst_dir', true), Zotero.ZotMoov.getBasePrefs())

What the code does is generate the file path with the wildcards without moving any file.

@elisaf8
Copy link

elisaf8 commented Nov 26, 2024

@wileyyugioh here you have it, I tried fidgeting around with names but always gives me errors. Maybe the issue is that the file path is not on locale but on OneDrive?

image

@wileyyugioh
Copy link
Owner

@wileyyugioh here you have it, I tried fidgeting around with names but always gives me errors. Maybe the issue is that the file path is not on locale but on OneDrive?

Can you try

await Zotero.ZotMoov._getCopyPath(Zotero.getActiveZoteroPane().getSelectedItems()[0], Zotero.Prefs.get('extensions.zotmoov.dst_dir', true), Zotero.ZotMoov.getBasePrefs())

Also try

(await Zotero.ZotMoov._getCopyPath(Zotero.getActiveZoteroPane().getSelectedItems()[0], Zotero.Prefs.get('extensions.zotmoov.dst_dir', true), Zotero.ZotMoov.getBasePrefs())).length

to get the path length

@elisaf8
Copy link

elisaf8 commented Nov 28, 2024

@wileyyugioh Tried both! Possibly the issue is the first one you highlighted, because Zootmove includes in the file path also the name of the file itself, which means that the majority of my file paths are longer than 260 characters. It now works with shorter directories... I'll try using a shorter path.

Thank you so much for helping!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants