I need help, again

Hi everyone

I would like an editortoolbar button to spit this out:

<<slidetext cap:"x (x) [[f|God and the Problem of Evil: Five Views]]" tid:"20240711162506">>

However, the only way I know how to do this is like this:

<$list filter="""[<now "YYYY0MM0DD0hh0mm0ss">addprefix[" tid:"]addsuffix[">>]]""" variable="suffix"><$action-sendmessage $message="tm-edit-text-operation" $param="wrap-selection" 
prefix="""<<slidetext cap:"x""" 
suffix=<<suffix>> />
</$list>

Which does everything but include the [[f|God and the Problem of Evil: Five Views]]

The brackets in the link immediately above mess with the brackets in the add prefix and add suffix snippet at the top. But trying to do the link the other way, as <$link to="God and the Problem of Evil: Five Views">f</$link>, causes problems because the quotes in the to operator conflict with the quotes in the snippet at the top. Unfortunately, it appears that ’ or “”" would also cause problems. The triple double quotes cause problems with the outer list filter. And single quotes will cause problems if the tiddler title linked to has a single quote or apostrophe.

I imagine the way forward is to have some kind of macro, er, I think you call them pragma now, but I haven’t been able to keep up, and I am okay with not knowing…where I could have the link [[f|God and the Problem of Evil: Five Views]] and have a $tid$ in the list filter above that gets replaced by the link. But I don’t know how to make that.

Is there anyone who can help me with the correct editortoolbar code for that? Keep in mind that I will regularly be changing the tiddler linked to.

I appreciate any help you can give. (See it as a break from arguing with each other over AI in TiddlyTalk…) :slight_smile:

Some quick hints are;

  • You are still free to use macros within twhich he $param$ name or $(varname)$ can be used
  • we now have the substitute operator
  • Functions can be used to store a filter, and even provide it with parameters, and use join[] within it to do the same as add prefix/suffix
  • The new backtick attribute forms allow substitution with
1 Like

Thanks Tones! All four tips were very helpful. The backticks were the easiest to employ, so I went with that. Blessings.