<$edit-text tiddler="temp" />
<$button>
Insert as transclusion
<$action-createtiddler $basetitle=<<currentTiddler>> text={{temp}} />
<$wikify name=newest-tid
text={{{ [prefix<currentTiddler>!sort[created]first[]] }}}
>
<$action-setfield
$tiddler=<<currentTiddler>>
text=<<some macro call to wrap Newest-tid in transclusion braces. This is not the problem.>> />
</$wikify>
<$action-deletetiddler $tiddler="temp"/>
</$button>
So, here's my current (flawed) solution. Imagine that it is an EditViewTemplate, i.e accessible in edit mode:<$edit-text tiddler="temp" />
<$button>
Insert as transclusion
<$action-createtiddler $basetitle=<<currentTiddler>> text={{temp}} />
<$wikify name=newest-tid
text={{{ [prefix<currentTiddler>!sort[created]first[]] }}}
>
<$action-setfield
$tiddler=<<currentTiddler>>
text=<<some macro call to wrap Newest-tid in transclusion braces. This is not the problem.>> />
</$wikify>
<$action-deletetiddler $tiddler="temp"/>
</$button>I suspect that the action-createtiddler is not finished by the time that wikify does its thing. So wikify doesn't get the new title, in spite of my hackey filter.
<$edit-text tiddler="temp" /><br><$button actions=""" <$vars transclusion={{{ [prefix<currentTiddler>!sort[created]first[]addprefix[{{]addsuffix[}}]] }}}> <$action-setfield $tiddler=<<currentTiddler>> text={{{ [<currentTiddler>get[text]addsuffix<transclusion>] }}}/> <$action-deletetiddler $tiddler="temp"/> </$vars> """> Insert as transclusion <$action-createtiddler $basetitle=<<currentTiddler>> text={{temp}} /></$button><br>{{||MakeTransclusion}} <$wikify name=newest-tid
text={{{ [prefix<currentTiddler>!sort[created]first[]] }}}
>
<$action-setfield
$tiddler=<<currentTiddler>>
text=<<some macro call to wrap Newest-tid in transclusion braces. This is not the problem.>> />
</$wikify>
Also are you sure you can't use set/vars instead of wikify?
<style>.edit100 { width:100%; }</style>
<$edit-text tiddler="temp" tag="textarea" minHeight="5em" class="edit100"
default="" placeholder="Enter content to be transcluded" /><br>
<$button actions="""
<$vars target={{{ [<currentTiddler>removeprefix[Draft of ']removesuffix[']] }}}>
<$vars transclusion={{{ [prefix<target>!sort[created]first[]addprefix[{{]addsuffix[}}]] }}}>
<$action-setfield $tiddler=<<currentTiddler>> text={{{ [<currentTiddler>{!!text}addsuffix<transclusion>] }}}/>
<$action-deletetiddler $tiddler="temp"/>
</$vars>
</$vars>
""">
Insert as transclusion
<$vars target={{{ [<currentTiddler>removeprefix[Draft of ']removesuffix[']] }}}>
<$action-createtiddler $basetitle=<<target>> text={{temp}} />
</$vars>
</$button>[...] the unusedtitle macro.