Thanks Eric. That looks just like what I need. I saw the first operator,
but thought it returned the entire title of the first item in the list. Now
I know better.
As far as using the description field goes, I have a custom tree macro that
uses the description field instead of the caption field. I did that (with
help) because I needed to use the caption field separately.
I'll let you know how it goes.
On Friday, January 8, 2021 at 6:01:50 PM UTC-7 Eric Shulman wrote:
> On Friday, January 8, 2021 at 4:06:27 PM UTC-8 History Buff wrote:
>
>> The copying of the title to the description field with the extra text I
>> think is relatively easy. However, I'm having trouble figuring out how to
>> extract the first character and the first three characters from the title.
>> Any suggestions?
>>
>
> Note: the TWCore "toc" macros use the "caption" field (not "description")
> to define the text to display for each toc entry.
>
> <$button> set captions
> <$list filter="...">
> <$action-setfield caption={{{ [[Railroad]] [{!!title}split[]first[]]
> [{!!title}split[]first[3]join[]] [{!!title}] +[join[-]] }}} />
> </$list>
> </$button>
>
> Notes:
> * The $list filter is whatever you want to use to select your desired "set
> of tiddlers".
> * For each matching tiddler, the caption field value is constructed using
> 5 filter "runs" within a "filtered transclusion" syntax: {{{ ... }}}
> * *[[Railroad]]* is literal text
> * *[{!!title}split[]first[]]* extracts the first character from the title
> * *[{!!title}split[]first[3]join[]]* extracts the first 3 characters from
> the title
> * *[{!!title}]* is the full title text
> * *+[join[-]]* combines the previous 4 parts with "-" in between each part
>
> The result is a single text value, e.g., "Railroad-A-Atc-Atchison, Topeka
> & Santa Fe Railway"
> which is then stored in the "caption" field of the current tiddler.
>
> 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/6d196855-0eae-455b-8d18-8f5318ddfb6en%40googlegroups.com.