TW5: splitting a TW file based on tags

110 views
Skip to first unread message

HowardM

unread,
Oct 21, 2014, 5:47:29 PM10/21/14
to tiddl...@googlegroups.com
I have a large file which is very slow to save individual tiddler edits on my iPad - I gather this is a recognised issue with the current version of the app which will be addressed in a future version of it.  In the meantime, I would like to split the file based on tags, but cannot find a way of doing so without individually dragging and dropping a very large number of tiddlers.  Has anyone found a simple way of doing this ?

I have previously applied a method using the Chrome Javascript console to delete tiddlers defined in a filter - I cannot remember who posted this advice - but this does not seem to work on TW5.1.2 - I just get 'invalid - unexpected token' messages.

Grateful for any help.

Howard


Jeremy Ruston

unread,
Oct 22, 2014, 6:20:04 AM10/22/14
to TiddlyWiki
Hi Howard

Here's a JavaScript snippet to delete all tiddlers matching a filter. It uses the filter string currently loaded in the advanced search tiddler so you can preview which tiddlers will be deleted:

var tiddlers=$tw.wiki.filterTiddlers($tw.wiki.getTiddlerText("$:/temp/advancedsearch"));for(var t=0;t<tiddlers.length;t++) {console.log("Deleting " + tiddlers[t]);$tw.wiki.deleteTiddler(tiddlers[t])};console.log(tiddlers.length + " tiddlers deleted");

Best wishes

Jeremy


--
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 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.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Howard Morrison

unread,
Oct 22, 2014, 7:29:48 AM10/22/14
to tiddl...@googlegroups.com
Hi Jeremy

That was great - your snippet allowed me to split my large file into seven separate files in 20 minutes.

Thanks for your help

Howard

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/E-pfgJHf0A0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Jon

unread,
Oct 23, 2014, 12:28:58 PM10/23/14
to tiddl...@googlegroups.com
Hi, this is exactly what I want to do.
Could you please give some instructions of where to put the snippet and how to execute it?

Thanks
Jon

Eric Shulman

unread,
Oct 23, 2014, 2:06:23 PM10/23/14
to tiddl...@googlegroups.com
On Thursday, October 23, 2014 9:28:58 AM UTC-7, Jon wrote:
Hi, this is exactly what I want to do.
Could you please give some instructions of where to put the snippet and how to execute it?

Open your browser's debugger console (ctrl-shift-J in Chrome).  Typically, to invoke javascript code from the console, you just type (or paste) the code into the input area, and press enter to execute.   The snippet of code that Jeremy provided should be copied/pasted as a single line of text.  That should do it.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:

Jon

unread,
Oct 23, 2014, 3:34:07 PM10/23/14
to tiddl...@googlegroups.com
Yes, got it working.
Thanks, Jon
Reply all
Reply to author
Forward
0 new messages