buttons icon indicating copy to clipboard operation
buttons copied to clipboard

`templater true` doesn't leave templates in `type`

Open ThisGuyCodes opened this issue 4 years ago • 4 comments

With the following button:

```button
name Event
type line(<% tp.file.content.split(/\r\n|\r|\n/).length %>) template
action bullet/event
templater true
```
^button-event

After pressing the button once It's now:

```button
name Event
type line(23) template
action bullet/event
templater true
```
^button-event

My expectation is the type line would still have the template in it.

ThisGuyCodes avatar Nov 18 '21 20:11 ThisGuyCodes

That should be working. I need to figure out a better way to handle templater in buttons so it is more reliable. Try reloading obsidian and see if that fixes the issue.

shabegom avatar Nov 20 '21 03:11 shabegom

Try reloading obsidian and see if that fixes the issue.

no dice, same behavior; happy to do any debugging you send my way

ThisGuyCodes avatar Nov 23 '21 14:11 ThisGuyCodes

I think I'll need to rewrite this feature unfortunately. I've seen it fail too many times.

shabegom avatar Nov 29 '21 14:11 shabegom

@shabegom do you have some clues/ideas as to what's going wrong when using templater in buttons? I've also been seeing inconsistent behavior, sometimes works no problems, sometimes the template is replaced in the button. My use case is creating new notes in a folder that are given a unique id:

```button
name New Action
type note(300 🚰 Pipelines/320 🛠 Actions/<% tp.date.now("YYYYMMDDhhmmss") %>, split) template
action 🛠 New Action
color purple
templater true
class dataview-button
\```

I'd be interested in where the issue lies/starting direction for a fix as this will be core to my workflow and having the button make itself unusable and even sometimes mangle the note it's inside, rather than only effect the new note, is quite frustrating.

tot0 avatar Dec 24 '21 19:12 tot0