http://inmysocks.tiddlyspot.com/#Search%20and%20Replace%20Tags
Thank you once again guys.
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/eGvsXFm8zAk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.
The main issue is that after one or two uses, the replace button disappears.
<$mangletags tiddler="Target" find="Tag to Remove" add="Tag to Replace">
<$button message="tm-mangletags">Click Me</$button>
</$mangletags><$button set=<<qualify "$:/state">> setTo="replace">
Replace All
</$button>
<$list filter="[tag[Old]]">
{{!!title}}
<$mangletags find="Old" add="New">
<$button message="tm-mangletags">
<$click type="match" state=<<qualify "$:/state">> text="replace"/>
</$button>
</$mangletags>
</$list>So I was merrily renaming tiddlers without replacing the tags.
I didn't twig till I read the last paragraph in your post.
All sorted now, thanks for the plugin.
@Metabele,
Don't we already have the ability yet to use lists with action widgets?
Yes, it's now possible (and very useful!).
In TW5.1.10, there will also be a tm-rename-tiddler message, which allow to rename a tiddler (scoop!), along with the update of tags and lists.
Hi Evolena,Yes, it's now possible (and very useful!).
In TW5.1.10, there will also be a tm-rename-tiddler message, which allow to rename a tiddler (scoop!), along with the update of tags and lists.
Ok, so 5.1.10 it is. Thanks for the pointers.
Best wishes,— tb
In addition, the use of bj's $click widget allows that all substitutions can be actioned with a single button click -- removing the necessity of having to individually click buttons down the list (although this functionality is retained.)
Find Tag:
<span title="Select a Tag to Find">
<$select tiddler="$:/temp/find" field="text" default='(none)'>
<option value="null">(none)</option>
<$list filter="[all[tiddlers]tags[]sort[title]]">
<option value=<<currentTiddler>>><$view field="title"/></option>
</$list>
</$select>
</span>
Replace With: <$edit-text tiddler="$:/temp/add" tag="input" type="text" placeholder="Add Me" />
<$button>
<$list filter="[tag{$:/temp/find}]">
<$fieldmangler tiddler=<<currentTiddler>>>
<$action-sendmessage message="tm-add-tag" param={{$:/temp/add}}/>
<$action-sendmessage message="tm-remove-tag" param={{$:/temp/add}}/>
</$fieldmangler>
</$list>
<$action-setfield $tiddler={{$:/temp/find}} title={{$:/temp/add}}/>
<$action-deletetiddler $tiddler={{$:/temp/find}}/>
<$action-sendmessage $message="tm-close-tiddler" $param={{$:/temp/find}}/>
replace
</$button>
|!search <$link to={{$:/temp/find}}><$view tiddler={{$:/temp/find}} field="title"/></$link>|!replace <$link to={{$:/temp/add}}><$view tiddler={{$:/temp/add}} field="title"/></$link>||<<list-links [tag{$:/temp/find}]>>|<<list-links [tag{$:/temp/add}]>>|
My widget is supposed to conditionally add a tag only iff the first tag is found (in the case that both find= and add= are specified) and unconditionally add or remove the tags if only one of the attributes is specified.
<$button>
<$list>
<$action-mangletags remove="old-tag" add="new-tag"/>
</$list>
</$button><$button>
<$action-mangletags tiddler="My Target" remove="old-tag" add="new-tag"/>
</$button>-- and the results are exactly as expected (find and replace.)