Export multiple tiddlers in one file selected by tag of field

Hello TW-Experts,

I want to export multiple tiddlers in one file selected by a tag or a field.
Looking to the Tidlywiki Doku I found only the manual version https://tiddlywiki.com/#How%20to%20export%20tiddlers

I am looking for a solution to export all tidlders having the tag “xyz” and/or the field author has the content “xyz”.

Thank you for help
Stefan

I deleted my last post because it was not structured correctly.

I created two tiddlers: New Tiddler 1 and New Tiddler 2 and gave them the tag: xyz

  1. Go to the Advanced Filter and select the Filter tab.
  2. In the search bar: enter in this filter: [search:tags[xyz]]
  3. Next to the search bar you will see some icons. One is the export icon. Click that.
  4. Export to CSV, JSON or Static HTML.
    -CSV will give you the closest thing to a text file.
    -JSON will give you a file you can re-import to a TiddlyWiki preserved as intact, individual tiddlers.
    Static HTML will give you an HTML of all the tiddlers.

Now, as for fields, the search query or advanced filter is basically the same.
I created tiddlers: New Tiddler 3 and New Tiddler 4 and gave them no tags, but gave them a field: sample-name with value abc
Advanced Search:
[search:sample-name[abc]]
It’s the same because tags IS a field (although native and established within TiddlyWiki) and sample-name is a field, although it was created (by me).
Export in a format that suits you.

There are other ways!
Here’s one for tag:
[tag[xyz]]
[sample-name[abc]]

AlfieA

You can use a $button widget to trigger a tm-download-file message, like this:

<$button> export selected tiddlers
	<$action-sendmessage $message="tm-download-file"
		$param="$:/core/templates/exporters/JsonFile"
		exportFilter="[tag[xyz]] [author[xyz]]"
		filename="tiddlers.json"/>
</$button>

enjoy,
-e

5 Likes

Thank you @EricShulman,

I created for documentation only three buttons

  1. Button will save all tiddler having tag xyz OR field author xyz
<$button> export selected tiddlers
	<$action-sendmessage $message="tm-download-file"
		$param="$:/core/templates/exporters/JsonFile"
		exportFilter="[tag[xyz]] [author[xyz]]"
		filename="tiddlers.json"/>
</$button>
  1. Button will save all tiddler having tag xyz AND field author xyz
<$button> export selected tiddlers
	<$action-sendmessage $message="tm-download-file"
		$param="$:/core/templates/exporters/JsonFile"
		exportFilter="[tag[xyz]] +[author[xyz]]"
		filename="tiddlers.json"/>
</$button>
  1. Button will save all tiddler having tag xyz AND NOT field author xyz
<$button> export selected tiddlers
	<$action-sendmessage $message="tm-download-file"
		$param="$:/core/templates/exporters/JsonFile"
		exportFilter="[tag[xyz]] -[author[xyz]]"
		filename="tiddlers.json"/>
</$button>

Stefan