Thanks Mark. I've got some questions before I try this. How much would it 
complicate things if I only wanted to perform this operation on tiddlers 
with a specific tag? Also, with the delay that you've mentioned, is this 
only for the first time it's run or every time I add a new tiddler?

Thanks,

Damon


On Thursday, December 13, 2018 at 10:23:33 PM UTC-7, Mark S. wrote:
>
> Ok. Here's code that should be able to do it.
>
>
> *But PLEASE make a backup of your work before trying this!!!! IT'S REALLY 
> IMPORTANT! THIS MACRO MAY CHANGE EVERY TIDDLER IN YOUR TW FILE!!*
>
> There are several caveats here.
>
> One is that *every eligible tiddler will have it's modification date 
> changed.*
>
> Do this on a desktop, not on a tablet or small device!
>
> Another, when you first save the tiddler with the button, there may be a 
> delay. You may be asked if you want to keep waiting. You need to keep 
> waiting.
>
> When you finally press the button, there will be even longer delays while 
> it processes. You will probably be asked several times if you want to wait 
> for the page before the process completes. It typically took 2 to 3 "waits" 
> on tiddlywiki.com, and there's only 1100 tiddlers there!
>
> I strongly recommend that you close out any tabs you don't need. In fact, 
> be sure all your work in all your applications is saved in case the browser 
> hangs the machine.
>
> At the top of the code you can set a value for min-per-group. This is the 
> minimum number of tiddlers you want before creating its own group entry. 
> Paste the code into a tiddler and close the tiddler. Then, if you're sure 
> you want to, press the button.
>
> The reason this code is so inefficient is that it is generating all 17576 
> possible combinations of 3 letters and checking to see if any of your 
> tiddlers match by title. A much more efficient code could have been written 
> with just a tiny bit of javascript. Oh well.
>
> Be careful!
> Have fun -- if you can!
>
> -- Mark
>
> \define min-per-group() 10
> \define ABC() A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
> \define xABC() A B C D E F
> \define regexpABC() (?i)^$(letr1)$$(letr2)$$(letr3)$
> \define glueABC() $(letr1)$$(letr2)$$(letr3)$
>
> <$button> Create alphabetical TOC structure
>    <$list filter="[enlist<ABC>]" variable=letr1>
>    <$list filter="[enlist<ABC>]" variable=letr2>
>    <$list filter="[enlist<ABC>]" variable=letr3>
>    <$list filter=
> "[all[tiddlers]!has[draft.of]regexp<regexpABC>rest<min-per-group>limit[1]]" 
> variable="dummy">
>    <$action-setfield $tiddler=<<glueABC>> tags=<<letr1>> /> 
>    <$list filter="[all[tiddlers]regexp<regexpABC>]" >
>       <$fieldmangler>
>             <$action-sendmessage $message="tm-remove-tag" $param=<<letr1>>/
> >
>             <$action-sendmessage $message="tm-add-tag" $param=<<glueABC>>
> />
>       </$fieldmangler>
>    </$list>
>        
> </$list>
> </$list>
> </$list>
> </$list>
> </$button>
>
>
>
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/83f82d95-209e-47d7-ad21-659820f51622%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to