remove tags meeting specific criteria

49 views
Skip to first unread message

paulgilbert2000

unread,
May 22, 2021, 3:46:19 PM5/22/21
to TiddlyWiki
HI ,

is there a command that could be used to remove certain tags that meet a specific criteria , say for example all tags that have a "#"  maybe ?

so if tiddler A  has "tag 1" "#tag 2" "tag 3"

is there a way to remove #tag 2  for example

i am also doing this part of creating a new  tiddler that inherits tags from another tiddler , but i dont want all of the tags


so i am hoping that there is something like that

<$action-sendmessage $message="tm-new-tiddler" remove tags= does not contain "#"

Odin

unread,
May 22, 2021, 4:03:36 PM5/22/21
to TiddlyWiki
I think you will need to select the tag using filters, and pass it to a variable with $setwidget or $varswigdet. Then you can use that variable inside the action-sendmessage widget to reference the tags to be removed.

Op zaterdag 22 mei 2021 om 21:46:19 UTC+2 schreef Mohamed...@hotmail.com:

Eric Shulman

unread,
May 22, 2021, 4:19:36 PM5/22/21
to TiddlyWiki
On Saturday, May 22, 2021 at 12:46:19 PM UTC-7 Mohamed...@hotmail.com wrote:
is there a command that could be used to remove certain tags that meet a specific criteria , say for example all tags that have a "#"  maybe ?
so if tiddler A  has "tag 1" "#tag 2" "tag 3"
is there a way to remove #tag 2  for example
i am also doing this part of creating a new  tiddler that inherits tags from another tiddler , but i dont want all of the tags

Try this:
<$button> test this
<$vars lb="[[" rb="]]">
<$action-sendmessage $message="tm-new-tiddler"
   tags={{{ [[Tiddler A]get[tags]enlist-input[]!prefix[#]addprefix<lb>addsuffix<rb>join[ ]] }}} />
</$vars>
</$button>

Notes:
* [Tiddler A]get[tags] gets the tags field value as a single text string
* enlist-input[] converts this to a list of individual tags
* !prefix[#] filters out the undesired tags
* addprefix<lb>addsuffix<rb> adds doubled brackets surrounding each tag (in case the tag names contain spaces
* join[ ] reassembles the individual tags back into a single text string

enjoy,
-e

paulgilbert2000

unread,
May 22, 2021, 5:07:29 PM5/22/21
to TiddlyWiki
Works!

Thank you Eric
Reply all
Reply to author
Forward
0 new messages