Link to download .tid archive

Hi guys,

I see some topics about creating a button to download .tid file directly here, but i cannot figure how to make a link to achieve the same.

I know we have the export options, but i trying to make a simple option for a specific tiddle.

Thanks in advance!

Hi, Do I understand it right. You need 1 PageControl button which always saves the same tiddler title?

The whole thing is very similar to the save “current-tiddler” button in the linked thread.

You need to change the \define myTiddler() HelloThere to \define myTiddler ????. Where ??? is your tiddler name. If you there are tiddlers with spaces you need to cover them with quotes. eg: “Quick Start”

title: :/_custom/ui/Buttons/save-myTiddler
tags: $:/tags/PageControls
caption: {{$:/core/images/star-filled}} Save myTiddler
description: Save myTiddler

\define myTiddler() HelloThere

\whitespace trim
\procedure actions()
<$action-sendmessage $message="tm-download-file" 
	$param="$:/core/templates/exporters/TidFile"
	exportFilter=<<myTiddler>>
	tv-history-list=<<tv-history-list>>
	filename={{{ [<myTiddler>] ".tid" +[join[]] }}}
/>
\end
<$button actions=<<actions>> tooltip="Save current-tiddler" class=<<tv-config-toolbar-class>> >
	<$list filter="[<tv-config-toolbar-icons>match[yes]]">
		{{$:/core/images/star-filled}}
	</$list>
	<$list filter="[<tv-config-toolbar-text>match[yes]]">
		<span class="tc-btn-text">
			<$text text="Save current-tiddler"/>
		</span>
	</$list>
</$button>

$___custom_ui_Buttons_save-current-tiddler.json (976 Bytes)

1 Like

Hi Mario, thank you for your answer. Sorry, i cannot express myself using english so well.

I dont need a button, if i can click in a text link inside the tiddle and save the content its enough.

For example, i have this dice app inside my wiki.

The player roll 6 results, click the link and send me the tid archive

ahh. OK. So we need to send a JSON file that contains several tiddlers.
Some questions:

  • You need links from different pages?
  • Those links need to send different tiddlers or always the same?
  • The 6 results, where are they stored?
    • In 6 different tiddlers? or
    • in tiddler fields?

Hi Mario, the results are generated by a plugin called Tiddly-Dice and showed inside the tiddle. When i press the Button Roll (Rolar) the plugin create a temporary tiddle with prefix $:/temp/roll.

The results are stored in temporary tiddles, like this:

$:/temp/roll
$:/temp/roll 1
$:/temp/roll 2
etc.

Inside every $:/temp/roll we have something like this:

<table><tbody><tr class="evenRow"><th align="center">Resultado<br>4d4+4</th></tr><tr class="oddRow"><td align="right">16 ( 2,3,3,4,4 )</td></tr></tbody></table>

The tiddle i want to include the button to save have this code inside:

\define custom_roll_actions()
<$wikify name="text" output="html" text="| !Resultado<br />{{$:/temp/roll}} |
| <$diceroll format=combo>{{$:/temp/roll}}</$diceroll>|">
<$action-createtiddler $basetitle="$:/temp/log/roll" tags="Roll" text=<<text>> />
</$wikify>
\end
<$keyboard key="Enter" actions=<<custom_roll_actions>> >
<$edit-text size="12" tag="input" default="" placeholder="2d6+3" tiddler="$:/temp/roll" />
</$keyboard>
<$button actions=<<custom_roll_actions>>>Rolar</$button>
<$button>
Limpar
<$list filter="[all[tiddlers+shadows]prefix[$:/temp/log]]">
<$action-deletetiddler $tiddler=<<currentTiddler>> />
</$list>
</$button>

<div style="color:black;">
<$list filter="[all[tiddlers+shadows]prefix[$:/temp/log]!sortan[]]">

<$transclude mode="block" />

</$list>
</div>

Thank you so much and sorry to bother you

OK. I did test it. But the temp-tiddlers contain a table … IMO you will not really be able to do something with it, other than read it.

What’s the “goal” of transferring the tiddlers to you?

If you import a set of tiddlers named: $:/temp/... they will be deselected in the import view. So it will be cumbersome for you to import it, because you have to manually select every single one of them.

So may be a $:/state/log/roll/ prefix may be preferable. But state-tiddlers are saved.
So it depends, on what you want to achieve. …

For the time being, here is a new page control button, that saves all tiddlers prefixed with $:/temp/log/roll. It uses 2 macros to define the myTiddlers filter and the fileName, which can be changed easily.

\define myTiddlers() [prefix[$:/temp/log/roll]]
\define fileName() rolls-player-x

___custom_ui_Buttons_save-mySet.json (986 Bytes)

But as I wrote. It depends on what you want, if those tiddlers make sense in your wiki.