\define newTiddler(title, fields)<$set name="tempTid" value=<<qualify "temp/$(currentTiddler)$">> ><$action-createtiddler $basetitle=<<__title__>> $savetitle=<<tempTid>>$fields$/><$action-sendmessage $message="tm-edit-tiddler" $param={{{[<tempTid>get[text]]}}} /></$set>\end
<$button>Test<<newTiddler test>></$button>
\define newTiddler(title:'New Tiddler', fields)<$set name="tempTid" value=<<qualify "$title$">> ><$button><$action-sendmessage $message="tm-new-tiddler" $param='HelloThere' title=<<qualify """$title$""">> $fields$/>New Tiddler</$button></$set>\end
<<newTiddler "bob" "bob=joe eddie=george">>
\define newTitle() myTiddler-{{{[tag[myTag]count[]add[$(inc)$]]}}}
\define newTiddler(n:0)<$set name="inc" value={{{ [<__n__>add[1]] }}}><$wikify name="myTitle" text="<<newTitle>>" ><$list filter="[<myTitle>] +[!has[title]]" emptyMessage=""" <$macrocall $name="newTiddler" n=<<inc>> /> """><$action-createtiddler $basetitle=<<myTitle>> tags="myTag" /></$list></$wikify></$set>\end
<$button actions=<<newTiddler>>>Create a new tiddler</$button>
\define newTiddler(template:"" title:'New Tiddler', fields)
<$set name="tempTid" value=<<qualify "$title$">> ><$button>
<$action-sendmessage $message="tm-new-tiddler" $param="""$template$""" title=<<qualify """$title$""">> $fields$/>
New Tiddler</$button></$set>\end
<<newTiddler "HelloThere" "bob" "bob=joe eddie=george tags='HELLO'">>
/*\title: $:/macros/OokTech/uniqueTitle.jstype: application/javascriptmodule-type: macroMacro to return a formatted version of the current time\*/(function(){
/*jslint node: true, browser: true *//*global $tw: false */"use strict";
/*Information about this macro*/
exports.name = "uniqueTitle";
exports.params = [ {name: "baseName"},{name: "options"}];
/*Run the macro*/exports.run = function(baseName, options) {if (!baseName) {baseName = $tw.language.getString("DefaultNewTiddlerTitle")} return this.wiki.generateNewTitle(baseName, options)};
})();
\define newTiddler(template:"" title:'New Tiddler' fields buttonText:"New Tiddler")<$button><$action-sendmessage $message="tm-new-tiddler" $param="""$template$""" title=<<uniqueTitle """$title$""">> $fields$/>$buttonText$</$button>\end
<<newTiddler "HelloThere" "bob" "bob=joe eddie=george tags='HELLO'" Potatoe>>
exports.name = "uniqueTitle";
<<unusedtitle baseName>>
One suggestion, where we use this feature? When we need to create a toddler using tm-new-tiddler. So, is it possible to merge it into tm-new-tiddler, then it can have another parameter basetitle. This way we can use title as before and basetitle like action-createtiddler.
Mohammad
But I previously found using a template with action-createtiddler required a process that created the field=value pairs eg text="""text content""" afield="a value" etc... and substituted these into the action-createtiddler widget.