Stupid tiddler tricks: the emergency data dump


One of the reasons I’ve been trying to trim my TiddlyWiki’s size down is to spend as little time as possible looking at the Red Box of Death:

Internal JavaScript Error

Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser.

uncaught exception: out of memory

This goes beyond mere annoyance for someone like me who doesn’t autosave after every edit (because of a combination of browser restrictions1, dozens of edits a day, and the size-related slowness of saving the damn file).

It happened again today, which brings me to the subject of this post, the “emergency tiddler export” feature. It’s in TiddlyWiki.com’s documentation but not very obvious in the TW file itself, and it deserves to be highlighted and more widely known.

It works like this:

  • Go to the Filters tab of Advanced Search.2
  • Use the filter [!is[system]!sort[modified]limit[25]], replacing “25” with however many tiddlers you’ve created or edited edited since your last save. (If you aren’t sure how many, guess high, or open another copy of your wiki in another browser tab and compare the two copies’ “Recent” lists.)
  • Click the “export tiddlers” button3 and save that batch of tiddlers as a JSON file.

Once you’ve reloaded your tab (or restarted your browser or computer, depending on how thoroughly you want to clean that memory or how thoroughly annoyed you are), you can import that JSON into your wiki and get those recently modified files.

– – –

There’s a slightly more cumbersome way to do the same thing:

  • Open those recently-modified tiddlers.
  • Export each one as a separate file, using the “export” option in its “More actions” drop-down menu.

And then import those files into the reloaded wiki as above.

There are a few reasons you might have found yourself doing it this way:

  • You didn’t know that the mystery icon in Advanced Search is a batch-export button. (I didn’t, at first.)
  • You didn’t know about Advanced Search at all. (I know because I’ve spent umpteen years watching the evolution of TW search.4 People who started more recently, or who only rarely use the search function, may not have ever noticed it.5)
  • You’d rather work with .tid files than JSON files. (I’m not sure why, though. Maybe you already have a folder full of backup .tid files, though that sounds like a lot more trouble than keeping redundant backups of the full wiki.)

  1. God, I miss TiddlyFox.

    I’ve looked at savetiddlers and file-backups and concluded that they’d generate more annoyance than they prevented. I’d have an easier time saving my wiki, a slightly harder time backing it up (because my TW subfolder would have to be moved deeper in my filesystem than it is now), and a substantially harder time managing my other downloads (because I’d have to stop using my browser’s “ask where to save each download” option).

  2. It’s the magnifying-glass icon next to the sidebar search box.
  3. It’s the one that looks like an open-top box with an arrow coming out of it. (If you tilt your head and squint, you can just about see the thought process behind that icon: up and out = upload = export.)
  4. I’m old enough to remember TiddlyWiki Classic’s native search function, which closed all the tiddlers you had open and opened every tiddler that matched your search query. It sucked hard enough that TW Classic’s own documentation site started using a community-made alternative.
  5. Footnote 2 was not intended as condescension.
Categories: PiecesTags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: