chhoumann / quickadd

QuickAdd for Obsidian
https://quickadd.obsidian.guide
MIT License
1.54k stars 136 forks source link

[BUG] Cannot capture to file #92

Closed maggiedelano closed 3 years ago

maggiedelano commented 3 years ago

Describe the bug I cannot use the quickadd capture feature. I receive this error:

QuickAdd: (LOG) Error: ENOENT: no such file or directory, rename '/Users/mdelano1/Library/Mobile Documents/iCloud~md~obsidian/Documents/iCloud/10 - PARA/12 - Areas/PKM/Possible Obs Improvements.md' -> '/Users/mdelano1/Library/Mobile Documents/iCloud~md~obsidian/Documents/iCloud/20 Book notes/Possible Obs Improvements.md'

I think it might have to do with the path length, because it works for files in the root directory of the vault.

To Reproduce Steps to reproduce the behavior:

  1. Create a capture for a note
  2. Set open, focus new pane, capture format - {{VALUE}}
  3. Trigger capture using command pallette

Expected behavior To be able to log tasks to an arbitrary file in the vault.

Desktop (please complete the following information):

chhoumann commented 3 years ago

Hey @maggiedelano. Thank you for reporting this!

I'm having trouble recreating the issue. Can you show me your Capture settings?

maggiedelano commented 3 years ago

Sure! Here's some screenshots of the setup. It gives me the error I included above silently in the console (nothing is shown to the user). Thanks!

Screen Shot 2021-09-03 at 3 06 43 PM Screen Shot 2021-09-03 at 3 06 50 PM
chhoumann commented 3 years ago

Hi @maggiedelano. Just wanted to leave a note here. I have been attempting to recreate the issue, but have so far not been in luck. I've tested on my Windows machine as well as my iPhone, but it works in both places with the exact settings you've provided above.

The error provided seems to indicate that the target file is in the 20 book notes folder rather than your PARA -> Areas -> PKM folder, which might be it? If that's the case, the file wouldn't be found.

maggiedelano commented 3 years ago

Hi @chhoumann! Thanks for looking into this further. I I took another look at this too and the issue is very strange. I have narrowed it down. It appears to be mac only (I can use the same file just fine on iOS). The issue appears to be due to the contents of the note. See video. The same note works fine when empty but fails when the existing note contents were in there.

I can't figure out exactly why it keeps failing; I have only successfully gotten it to append to an empty file. I tried removing a few tasks, cycling the tasks.

Also I don't have a folder called 20 Book notes so I have no idea why it is telling me to move the note there.

maggiedelano commented 3 years ago

You know what, I just figured it out! It's because I have this templater line in the file:

<% await tp.file.move("20 Book notes/" + tp.file.title) %>

I had it in there as an example for a future template I was going to work on...

That's where the 20 Book notes comes from.

No idea why it works on iOS and not mac though, but it works fine if I take that line out. Thanks for your help!

chhoumann commented 3 years ago

Ooh, that makes sense! Super happy that it's resolved now. Glad to help!