Deletion of tiddlers based on search

119 views
Skip to first unread message

Dupui Uis

unread,
Mar 21, 2021, 6:04:04 PM3/21/21
to TiddlyWiki
Hi! New to tiddlywiki, was searchig for a way to delete tiddlers based on search/mentions in any tiddler. I found this old code (see below) that only works with filters e.g. tag[test] but not with any search. Would anyone be able to help here? 

Goal: write any string in the search bar and tiddler will search any mention of the string. You can choose to checkmark the tiddlers you choose to delete and select the button to delete selection.

Thank you!

\define listflter() [$(basefilter)$]
\define exclude()
[is[tiddler]$(basefilter)$] -[exclusionstatus[exclude]]
\end

<$edit-text tiddler="$:/temp/delete-filter" tag="input" placeholder="enter a filter" default="" size=50/>
<$reveal state="$:/temp/delete-filter" type="nomatch" text="">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/delete-filter" $field="text" $value=""/>
{{$:/core/images/close-button}}
</$button>
</$reveal>

<$set name="basefilter" value={{$:/temp/delete-filter}}>

<$reveal state="$:/temp/delete-filter" type="nomatch" text="">
<$list filter=<<listflter>>>

<$checkbox field="exclusionstatus" checked="include" unchecked="exclude" default="include"><$link to={{!!title}}></$link></$checkbox>
</$list>
</$reveal>

<$button>Delete Selected
<$list filter=<<exclude>>>
<$action-deletetiddler $filter=<<exclude>>/>
</$list>
<$list filter="[has[exclusionstatus]]">
<$action-setfield $field="exclusionstatus"/>
</$list>
</$button>
</$set>

Eric Shulman

unread,
Mar 21, 2021, 9:14:04 PM3/21/21
to TiddlyWiki
On Sunday, March 21, 2021 at 3:04:04 PM UTC-7 dupui...@gmail.com wrote:
searching for a way to delete tiddlers based on search/mentions in any tiddler.

My "PowerSearch" filter generator might be what you need:


To install into your own document:

2) drag-and-drop the "PowerSearch" and "edit-list" tiddlers into your TiddlyWiki (both are needed)

That's it.  As soon as they are present in your TiddlyWiki, you can use PowerSeach to enter a variety of criteria to locate a set of matching tiddlers.  You can then use the PowerSearch "delete" button (trash can) to remove all matching tiddlers from your document.

enjoy,
-e


Dupui Uis

unread,
Mar 22, 2021, 11:23:24 PM3/22/21
to TiddlyWiki
Thank you Eric! You're amazing, love your creation! This will definitely help refine the search for tiddlers to delete. 

Many thanks,
Dup
Reply all
Reply to author
Forward
0 new messages