This version:

<$button>
<$list filter="[all[current]fields[]]" variable="fieldname">
<$list filter="[all[current]get<fieldname>prefix[1]suffix[1]]" 
variable="dummy" >
<$list filter="[title<fieldname>getindex[origin]]" variable="origin">
<$action-setfield $field="aaa" $value=<<origin>>/>
<<origin>>
</$list>
</$list>
</$list>
</$button>

Will put the final value of <<origin>> into the "aaa" field of the current 
tiddler (I'm not sure if that's what you meant to do, but that's what it 
does).

The main thing was to make $value=<<origin>>. When you assign a 
macro/variable inside a widget you need the <<notation>> without quotes.  
As a digression, the exception to this rule might when you use the wikify 
widget, which has the ability to look inside a string of wikitext and 
render it the way it would as wikitext and then assign it to a variable. 

The other thing, is that you didn't use a button or other widget to 
activate the ActionSetField widget. All the Action-Do-Thingies need to be 
activated by some event (typically a button, radio button, select widget, 
etc.) The main point, I think, is to prevent actual changes to your TW from 
occurring until you're actually ready.

HTH

-- Mark


On Sunday, August 5, 2018 at 2:40:03 PM UTC-7, Dave wrote:
>
> When I use the <$count> widget, (no more fruit - this is the actual 
> content I'm dealing with)
>
> <$list filter="[all[current]fields[]]" variable="fieldname">
> <$list filter="[all[current]get<fieldname>prefix[1]suffix[1]]" 
> variable="dummy" >
> <$list filter="[title<fieldname>getindex[origin]]" variable="origin">
>  <<origin>>:<$count filter=" <<origin>>"/><br>
> </$list>
> </$list>
> </$list>
>
> I get a list like this:
>
> cbm cbm.midline:1
> pmrf:1
> pmrf:1
> [[opp motor cortex]]:1
> pmrf cn8:1
>
> There are 2 obvious problems: 
> 1) the count treats each "sentence" (a line from a data tiddler) rather 
> than each "word", and
> 2) the count is only valid for each "pass" through the filter, so 
> everything will come out as "1"
>
> So I thought the best start would be to assign the output of the whole 
> filter to a field for further processing.
> The filter set to output just "<<origin>>" by itself results in "cbm 
> cbm.midline pmrf pmrf [[opp motor cortex]] pmrf cn8", 
> which should be easier to deal with, but this doesn't seem to set the 
> results in the field "aaa" of the current tiddler:
>
> <$list filter="[all[current]fields[]]" variable="fieldname">
> <$list filter="[all[current]get<fieldname>prefix[1]suffix[1]]" 
> variable="dummy" >
> <$list filter="[title<fieldname>getindex[origin]]" variable="origin">
> <$action-setfield $field="aaa" $value="<origin>"/>
> <<origin>>
> </$list>
> </$list>
> </$list>
>
> I tried all of the following
>
> $value="<origin>"
> $value=<origin>
> $value="<<origin>>"
> $value=<<origin>>
> $value="$<origin>$"
> $value=$<origin>$
>
> but none of them resulted in a field "aaa" at all, let alone one filled 
> with the proper content.
>
> Just before posting this I tried all variations of:
>
> <$action-setfield field="aaa" value="<origin>"/>
>
> i.e. I spotted that "field" and "value" didn't need the "$" like the 
> "$tidder" would in the tiddlywiki.com examples
>
>
> What am I doing wrong here?  I should be able to get that filter-produced 
> string "cbm cbm.midline pmrf pmrf [[opp motor cortex]] pmrf cn8" into a 
> field, shouldn't I?
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/59ab7d75-9b41-42d1-9b30-b1e6ad32db98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to