On Monday, October 19, 2020 at 7:30:49 AM UTC-7, Sapphireslinger wrote:
>
> When I hit the "New Quote" button embedded in all my book tiddlers, I want 
> to get a new tiddler tagged with (1) the title of the currentTiddler, (2) 
> the variable contained in the author field and (3) the word "quote". 
> I searched and tried all kinds of permutations for 2 hours but can't 
> figure it out. The version below makes a tag for every word of the tiddler 
> title and the author field, besides creating a weird field. :P 
>

Give this a try:
\define newtags() [[$(currentTiddler)$]] [[$(author)$]] [[quote]]

<$list filter="[<currentTiddler>prefix[Book -]]">
   <$button> New Quote
      <$vars author={{!!author}}>
      <$action-sendmessage $message="tm-new-tiddler" title=<<now 
"YYYY.0MM.0DD.0hh0mm0ss 
QUOTE - ">> tags=<<newtags>> />
      </$vars>
   </$button>
   <$list filter="[tag<currentTiddler>!sort[title]]">
   <h2><$link><$transclude field="title" mode="block"/></$link></h2>
   <$transclude field="text" mode="block"/>
   </$list>
</$list>

Notes:
1) The newtags() macro constructs the desired tags field value, using 
[[...]] around each tag to handle spaces embedded in the current tiddler's 
title and author fields
2)  The $button gets the author field value as a variable, so that the 
newtags() macro can refer to $(author)$ internally

enjoy,
-e

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b925c2f9-be8d-4863-885d-f9c9f477d5b4o%40googlegroups.com.

Reply via email to