Hi Omit,

Try this:

\define export-to-json(tag:"public", fileName:"export.json")
<$button>
<$action-sendmessage $message="tm-download-file" 
$param="$:/core/templates/exporters/JsonFile" 
exportFilter="""[tag[$tag$]]""" filename="""$fileName$"""/>
{{$:/core/images/export-button}} export ''<$count filter="[tag[$tag$]]"/>'' 
tiddler(s) tagged: "$tag$" to "$fileName$"
</$button>
\end

<<export-to-json tag:"public" fileName:"asdf.json">>

It creates a macro named: export-to-json
The macro has 2 predefined parameters: tag, fileName. They can be redefined 
with the macro call. see the last line. 
The macro also produces a rather long button eg: [export 1 tiddler(s) 
tagged: "public" to "asdf.json"] 
This can be made shorter, by deleting the stuff you don't need. 

the following macro creates a short button with a tooltip text

\define export-to-json(tag:"public", fileName:"export.json")
<$button tooltip="""export tiddler(s) tagged: "$tag$" to "$fileName$" """>
<$action-sendmessage $message="tm-download-file" 
$param="$:/core/templates/exporters/JsonFile" 
exportFilter="""[tag[$tag$]]""" filename="""$fileName$"""/>
{{$:/core/images/export-button}} (<$count filter="[tag[$tag$]]"/>)
</$button>
\end


have fun!
mario

-- 
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/d831d1d8-813d-4c68-9c70-4fda6683c583%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to