quickadd icon indicating copy to clipboard operation
quickadd copied to clipboard

Question: {{Value: <variable name>}}

Open jaymaleoca opened this issue 2 years ago • 2 comments

Thank you again for this awesome plugin.

One thing that I'm not very clear on.

  • Can we do a {{Value: + suggester items}}
  • or is it limited to doing:
    • either {{Value: }}
    • or {{Value: comma-separated suggester items}}?

What I'm trying to do is ---

  1. Starting a new file prompts a suggester list
  2. This choice input is used to name the file
  3. The value I selected is passed onto either Templater or Metaedit to update a tag and/or Dataview inline field

Thank you.

Reference to: image

jaymaleoca avatar Apr 29 '22 18:04 jaymaleoca

I would love this functionality, if I understand it correctly: to select from a pre-defined list AND be able to write-in a custom selection during the prompt if we want to.

ces3001 avatar May 04 '22 21:05 ces3001

Hi ces3001, maybe...; maybe what you describe might be a bit different.

Right now, I know that we can do {{VALUE: choice_A, choice_B, choice_C,...}} in QuickAdd. choices_A to C will show up as a prompt/dropdown box when the QuickAdd is triggered.

I am also seeing in the documentation about what coming after the colon (:) as the variable name.

What I'm wanting to do is --- let's say we choose choice_A; I want it to be able to carry over/export to Metaedit -- and have it automatically inserted into the note.

(A workaround that I have found/am doing now is --- because many of my file names follow a naming convention, I'm using Templater to slice that "choice_A" information from the file title and insert it in the note field.)

jaymaleoca avatar May 06 '22 00:05 jaymaleoca

I don't know if this might be similar, but thought I'd throw it out there. I wanted to set a type: field in the frontmatter from a selector and then use that type field to set a tag, all via Quick Add.

Initially, I created a capture macro with File Name set to "/{{VALUE:Title}}". This capture macro also enables Open, Focue new pane, and Capture format. The Capture format is set to:

---
type: {{VALUE:index, moc}}
title: <% tp.file.title %>
---

Then I created a second Capture macro with the following enabled: Capture to active file, Write to bottom of file, and Capture format. The Capture format is simply set to:

#<% tp.frontmatter.type %>

Basically, take the frontmatter set by the first macro and use it in the second macro for the tag. Unfortunately, this didn't work...until...I add inserted "Add wait command" between these two macros. So my "Add IMF" macro simply looks like:

  1. Create IMF
  2. Wait for 100ms
  3. Add IMF Tag

Then I create a QuickAdd Choice of type Macro and select my "Add IMF" macro. Now it prompts for the Filename, whether this is an Index or MOC, sets up the frontmatter for my note and sets a tag based on the Type field in the frontmatter. The key was inserting that Wait Command.

jamesx4 avatar Nov 02 '22 21:11 jamesx4