JabRef / JabRef/jabref

Drag-and-drop and move file to file directory in macOS does not work

Open
#7,679 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component: external-files platform: macos status: depends-on-external
Dominant language
Java
Stars
4.7k
Forks
3.6k
Avg merge
23h 39m
Merged PRs (30d)
381

Description

JabRef version on

JabRef 5.2--2020-12-24--6a2a512
Mac OS X 10.16 x86_64 
Java 15.0.1
  • Mandatory: I have tested the latest development version from http://builds.jabref.org/main and the problem persists (in JabRef 5.3--2021-04-29--cfb14b2 Mac OS X 10.16 x86_64 Java 15.0.2 JavaFX 16+8)

Steps to reproduce the behavior:

  1. Open Entry editor on "General" tab.
  2. Drag and drop file from, say, Downloads folder to the File field while pressing Option (on macOS) to move file to the file directory.
  3. Expected behavior: the file is moved from Downloads folder to the file folder and renamed according to the rule Main file directory + File directory pattern + Filename format pattern (set in Jabref Preferences -> Linked Files).
  4. Observed behavior: the file is copied to Main file directory and renamed according to the Filename format pattern. That is, there are two bugs: 1) Option key does not enforce moving instead of copying; 2) File directory pattern is ignored.

Example.
I try to link a PDF file named ~/Downloads/pcbi1000.pdf to a BibTex entry with fields (bibtexkey = Author2021, title="My Wonderful Paper", year=2021) and move it with rename pattern to the file directory.
My settings are:

  • Main file directory: /Users/dima/Documents/References
  • File directory pattern: papers/[year]
  • Filename format pattern: [bibtexkey] - [title]

Therefore, I expect the file to be renamed from from ~/Downloads/pcbi1000.pdf to /Users/dima/Documents/References/papers/2021/Author2021 - My Wonderful Paper.pdf.
Observed behavior: File is copied to /Users/dima/Documents/References/Author2021 - My Wonderful Paper.pdf

Log File
Paste an excerpt of your log file here

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the Entry editor's General tab and trace the file-field drag-and-drop handling, then check how the Linked Files preferences provide the Main file directory, File directory pattern, and Filename format pattern. Reproduce the macOS Option-key case using the example settings. Done means the source file is moved rather than copied and the configured directory and filename patterns are both applied.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.