chhoumann / quickadd

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

Better defaults for Format Syntax null values #448

Open chhoumann opened 1 year ago

chhoumann commented 1 year ago

Is your feature request related to a problem? Please describe. Instead of inserting undefined in notes (or null), just put an empty string in there. This increases flexibility.

Also, requested in a few places (e.g. survey), #209. Want to check out all format syntax values, so keeping this as 'wrapper' for issues related to only one.

Describe the solution you'd like {{LINKCURRENT}} and {{VALUE}} become empty strings if no values are given / no file is open. Only exit workflow when Cancel is pressed.

Any feedback on this? Thoughts? Agree/disagree?

FeralFlora commented 11 months ago

Can captures actually handle when the capture format has {{LINKCURRENT}}, but there is no active file? I just get an error (unable to get current file path), and nothing is captured.

FeralFlora commented 10 months ago

Disregard my previous comment, I misunderstood something.

I've just run into this issue, because I am extending the Zotero API script and defining new variables, for example for the frontmatter.

For example, I am assigning a variable like so (this is Zotero notes that are shorter than 20 words):

comments: shortNotes ? shortNotes.map(note => `- ${note.text}`).join('\n') : "",

I put this into my frontmatter like so: {{VALUE:comments}}.

It works great if there are shortNotes. But, in this case, if there are no short notes, the value should be an empty string. Instead, Quickadd prompts me for a value for this variable.