TW5: How to delete many tiddlers at once?

130 views
Skip to first unread message

Chuck R.

unread,
Jan 7, 2020, 11:20:58 AM1/7/20
to TiddlyWiki
My system: TW5.1.19 on Tiddlyspot.com using Google Chrome browser.

I am in the process of splitting one TW5 file into 2 files, so I copied the file to another spot on Tiddlyspot. So now I'm deleting, from the new TW5 file, the tiddlers I no longer need. However I must have 60-70 tiddlers left to delete. Is there a way to list all tiddlers and check a box next to the ones I want to delete?

Thank you.

Eric Shulman

unread,
Jan 7, 2020, 11:45:08 AM1/7/20
to TiddlyWiki
On Tuesday, January 7, 2020 at 8:20:58 AM UTC-8, Chuck R. wrote:
My system: TW5.1.19 on Tiddlyspot.com using Google Chrome browser.

I am in the process of splitting one TW5 file into 2 files, so I copied the file to another spot on Tiddlyspot. So now I'm deleting, from the new TW5 file, the tiddlers I no longer need. However I must have 60-70 tiddlers left to delete. Is there a way to list all tiddlers and check a box next to the ones I want to delete? 

This will do it:

<$list filter="[all[tiddlers]]">
   <$checkbox field="selected" checked="true" unchecked="false">
      <$link />
<br>
   </$checkbox>
</$list>
<$button> delete selected tiddlers
   <$list filter="[all[tiddlers]selected[true]]">
      <$action-deletetiddler $tiddler=<
<currentTiddler>> />
   </$list>
   <$list filter="[all[tiddlers]selected[false]]">
      <$action-deletefield $tiddler=<
<currentTiddler>> $field="selected" />
   </$list>
</$button>



notes:
* the first filter lists all tiddlers, and shows a checkbox for each
* the checkbox adds a field to the listed tiddler: selected=true/false
* the button invokes $action-deletetiddler for each tiddler that has field selected="true"
* the button also invokes $action-deletefield for each tiddler that has field selected="false"
* this is in case you selected a tiddler and then changed your mind and deselected it

-e

springer

unread,
Jan 7, 2020, 12:58:23 PM1/7/20
to TiddlyWiki
Eric, I just tried copying your "select and delete" code over to my tiddlyspot, and found that the checkboxes had no visible text next to them (only the gear-icon next to most). Hovering over each showed a hint (at bottom of browser where link URLs are previewed), but the checkboxes were otherwise anonymous-looking... Any clue what would account for that? (I'm generally using Commander for such tasks, and it's not at all urgent for my sake, but was impressed by how lean your select-list-plus-button approach would be. And perhaps my note will also help troubleshoot for Chuck?)

-Springer

Mark S.

unread,
Jan 7, 2020, 1:10:35 PM1/7/20
to TiddlyWiki
It works for me. I'm wondering if there is some sort of clash between linking and the checkbox and/or CSS. Try replacing <$link /> with <$view field=title /> . Linking isn't really required here.

Mohammad

unread,
Jan 7, 2020, 2:15:13 PM1/7/20
to TiddlyWiki
Chunk R.

While Eric solution is brilliant! You can also use the Tiddler Commander.
It lets you to use different filters and then selectively delete tiddlers.

--Mohammad

Mohammad

unread,
Jan 7, 2020, 2:16:30 PM1/7/20
to TiddlyWiki
Added to TW-Scripts.

springer

unread,
Jan 7, 2020, 2:48:22 PM1/7/20
to TiddlyWiki
Mark, and Eric: yes, replacing the link with <$view field=title /> makes it behave properly on my tiddlyspot site.

Eric Shulman

unread,
Jan 7, 2020, 3:19:38 PM1/7/20
to TiddlyWiki
On Tuesday, January 7, 2020 at 9:58:23 AM UTC-8, springer wrote:
Eric, I just tried copying your "select and delete" code over to my tiddlyspot, and found that the checkboxes had no visible text next to them (only the gear-icon next to most). Hovering over each showed a hint (at bottom of browser where link URLs are previewed), but the checkboxes were otherwise anonymous-looking... Any clue what would account for that?

Normally, the <$link> widget has content to display, like this:
   <$link><$text text=<<currentTiddler>> /></$link>

However, if the desired content is just to display the current tiddler title, you can use the <$link /> abbreviated syntax

This abbreviated syntax was added in 5.1.20, so perhaps you are using an older revision of the TWCore?

Here's the github discussion about this newer syntax: https://github.com/Jermolene/TiddlyWiki5/issues/3974

-e
 

springer

unread,
Jan 7, 2020, 10:54:50 PM1/7/20
to TiddlyWiki
Eric, FWIW, I'm using 5.1.21 so perhaps it's something about my plugin set. If it's helpful for anyone I can troubleshoot, but I was just chiming in here about my experience in case it reflected something larger than my own case.
-Springer
Reply all
Reply to author
Forward
0 new messages