On Saturday, June 6, 2020 at 9:02:18 PM UTC-7, Eric Shulman wrote: 

I've made a small change to my previous "change tag" code:

when you press the "change" button, instead of simply clearing the current 
select list value,
it now sets the select list value to the new tag value and clears the "new" 
tag input.  This makes
it easy to change the same tagged tiddlers again (e.g., in case you made a 
typo or changed your mind)

The code differences are shown below using red text:
 

> <$select tiddler="$:/temp/changetag/old" default="">
>    <option value="">select an existing tag...</option>
>    <$list 
> filter="[tags[]sort[]]"><option><<currentTiddler>></option></$list>
> </$select>
> <$edit-text tag="input" tiddler="$:/temp/changetag/new" default="" 
> placeholder="enter a new tag..." />
> <$button> change
>    <$list filter="[tag{$:/temp/changetag/old}]">
>       <$action-listops $tiddler=<<currentTiddler>> $field="tags" 
> $subfilter="-[{$:/temp/changetag/old}] [{$:/temp/changetag/new}]" />
>    </$list>
> *   <$action-setfield $tiddler="$:/temp/changetag/old" 
> text={{$:/temp/changetag/new}} />*
> *   <$action-deletetiddler $tiddler="$:/temp/changetag/new" />*
> </$button>
> <$button> reset
>    <$action-deletetiddler $filter="[prefix[$:/temp/changetag]]" />
> </$button><br>
> Change these tiddlers:<br>
> <$list filter="[tag{$:/temp/changetag/old}]"> <li><$link/></li> </$list>
>
 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/178875d1-759b-4789-bb5f-5b4eb132e7f2o%40googlegroups.com.

Reply via email to