*That is definitely short and sweet (elegant !).*  Thanks for posting!  
Great to have in one's toolkit (i.e. knowledge of listops, or simply 
availability of excellent pre-canned solutions to focus on bigger 
problems), so into my back-pocket for delving into someday it all goes.

I'm on a hyper-focused quest to fully explore TiddlyWiki filtering, so 
although on my radar, I've buried listops far under the pile until I've 
pretty well tapped-out the possibilities with filters.  It is very easy to 
get overwhelmed trying to learn/remember/practice the whole buffet of 
options re TiddlyWiki options/features/etc.

I also tend to avoid plugins, however fantastic, unless they solve a 
problem I'm really not interested in solving.  For most things, trying to 
solve them with transclusions and filtering are just too strong and 
exciting/attractive exercises for this kid to pass up.

For anybody with the time and desire to dabble in "the weeds of TiddlyWiki 
empowerment", filtering is, to me, the greatest place to focus on.  "How 
would I do this/that with filters", they are such great exercises.  Well, 
this old fella sees those as great brain-age exercises of the 
puzzle-solving kind.  Every new thing learned re filtering feels like an 
opening up of exponential possibilities.  (I have way too much fun with 
this stuff...)






On Saturday, June 5, 2021 at 1:23:08 PM UTC-3 Mohammad wrote:

> It's a bit complicated! but it works!
>
> have a look at TW-Scripts for example
>
>
> https://kookma.github.io/TW-Scripts/#Add%20Remove%20Tags%20Using%20ActionListops
>
>
>
> Best wishes
> Mohammad
>
>
> On Sat, Jun 5, 2021 at 7:56 PM Charlie Veniot <cj.v...@gmail.com> wrote:
>
>> Nah, I didn't consider that because the particular TiddlyWiki instance 
>> I'm working with I've setup with only single-word tags.
>>
>> So no, that particular code sample was not designed for a tag with words 
>> separated by spaces.
>>
>> To handle any multi-word tag with spaces between the words:
>>
>> \define doIt()
>> <$vars ldb="[["
>>               rdb="]]">
>> <$list variable="thisTiddler" filter="[tag[A]]">
>> <$action-setfield $tiddler=<<thisTiddler>> $field="tags" $value={{{ 
>> [<thisTiddler>tags[]addprefix<ldb>addsuffix<rdb>join[ ]] 
>> [[mot]addprefix<ldb>addsuffix<rdb>] +[join[ ]] }}}/>
>> </$list>
>> </$vars>
>> \end
>>
>> <$button actions=<<doIt>>>
>> Tag Em
>> </$button>
>>
>> I've also wrapped the new tag (hard-coded in my code sample as "mot") 
>> with double-brackets, so that if you replace "mot" with a 
>> multi-word-separated by spaces tag, the code still works otherwise as-is.  
>> (in the case of a single-word, or CamelCase word, TiddlyWiki will ignore 
>> the double-brackets.)
>>
>> If you want to make the actions macro more generalized, then you'll want 
>> to add a parameter (newTag?), and then replace "mot" with "$newTag$", I 
>> think without trying it.
>>
>>
>> On Saturday, June 5, 2021 at 6:33:51 AM UTC-3 Mohammad wrote:
>>
>>> Does this work if you want to add [[newTag from code]]?
>>> Or if the tiddlers already have a tag with space in the title?
>>>
>>>
>>> Best wishes
>>> Mohammad
>>>
>>>
>>> On Sat, Jun 5, 2021 at 10:01 AM Charlie Veniot <cj.v...@gmail.com> 
>>> wrote:
>>>
>>>> G'day,
>>>>
>>>> I'm refactoring the design on a TiddlyWiki project, and wanted to apply 
>>>> tag changes to batches of tiddlers.
>>>>
>>>> In case of any interest, here's the related code pattern:
>>>>
>>>> \define doIt()
>>>> <$list variable="thisTiddler" filter="[tag[A]]">
>>>> <$action-setfield $tiddler=<<thisTiddler>> $field="tags" $value={{{ 
>>>> [<thisTiddler>tags[]] [[mot]] +[join[ ]] }}}/>
>>>> </$list>
>>>> \end
>>>>
>>>> <$button actions=<<doIt>>>
>>>> Tag Em
>>>> </$button>
>>>>
>>>> Cheers !
>>>>
>>>> -- 
>>>> 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+...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/tiddlywiki/9b84cbd5-ce87-4611-a180-4dccaf611061n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/tiddlywiki/9b84cbd5-ce87-4611-a180-4dccaf611061n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/832ea5f8-e467-4e28-8785-a58ccb02562en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/tiddlywiki/832ea5f8-e467-4e28-8785-a58ccb02562en%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f5c68508-6cf6-4682-b39c-d91299a3a61en%40googlegroups.com.

Reply via email to