hans / obsidian-citation-plugin

Obsidian plugin which integrates your academic reference manager with the Obsidian editor. Search your references from within Obsidian and automatically create and reference literature notes for papers and books.
MIT License
1.04k stars 77 forks source link

Ctrl-Shift-O does not create a new note after selecting an item from the list #209

Closed PeteCT closed 1 year ago

PeteCT commented 1 year ago

Describe the bug

Ctrl-Shift-O opens the list of items in my Zotero database, but pressing return does not create a new note if the selected item has no associated note, nor will it open an existing note if the selected item does have an associated note.

On the first attempt to create a new note after turning on the plugin, a message flashes in the upper right corner, something like: Unable to access literature note. Please make sure the literature note folder exists or update plug-in settings.

This message does not appear on subsequent attempts to create a new note.

All other functionality of Ctrl-Shift-O works as expected.

Also, please note that when I select "Citations: Insert literature note content in the current pane" from the command palette, it works as expected.

To Reproduce Steps to reproduce the behavior:

  1. Click Ctrl-Shift-O
  2. select an item
  3. hit return

Expected behavior I expect it to create a new note using the template, as described.

Platform

orionpilot commented 1 year ago

This feels similar to #194. See my comment here, https://github.com/hans/obsidian-citation-plugin/issues/194#issuecomment-1271574258 for debugging steps. In short, how does your plugin settings look like? If the folder that you want the notes to live in does not already exist when you want to create the note, the plugin does not create it for you, and this error can occur.

PeteCT commented 1 year ago

Thanks @orionpilot -- I'm making progress! When I specify no path for the Literature Note folder, Ctrl-Shift-O creates a note at the root as expected. It still isn't working when I specify my target folder which already exists.

Perhaps the issue is that my target folder is in iCloud? I use iCloud for syncing to iOS. Here's the path I get when I use Finder to copy my preferred target folder as pathname (via right click):

/Users/myUserName/Library/Mobile Documents/iCloud~md~obsidian/Documents/Personal/ideas

edit: formatting is coming out funky above... there are tildes where the dashes are here: /iCloud-md-obsidian/

image
orionpilot commented 1 year ago

Good to hear progress is being made! As for the issue, its entirely possible that its iCloud causing the problem. I have heard about iCloud syncing causing some issues before. However, you said that its working when no folder is specified, i.e. they are created in the root. Are you setting the literature note folder as an absolute or relative directory? The folder here should be relative from the vault root (confirmed by checking my own vault). If you are setting an absolute directory, then Obsidian can't find that folder inside the vault. This would also explain why not specifying a folder works.

And fyi, the formatting issue you had is that tilde's are used for strikethrough text in markdown i.e., ~md~ renders as ~md~.

PeteCT commented 1 year ago

That did it! Thank you.

For future readers of this thread, make sure to set your literature note folder path to the path beneath (and excluding) the vault folder itself.

So in my example above, the vault is called "Personal" and my desired literature notes folder, "Ideas", is within the Personal folder. In the plug-in settings, I set the Literature note folder to: "/ideas"