How to clone a Tiddler with a new separator instead of space

Hello TW-Community,

I got from @pmario a solution to exchange the space by another separator if I create a new tiddler How to exchange the space separator before the number of new tiddler - Discussion - Talk TW.

\procedure new-entry(selector, sep)

  \procedure new-tiddler()
    <$wikify name="title" text=`<<unusedtitle baseName:"$(selector)$" separator:"$(sep)$" startCount:"01" template:"$basename$$separator$$count:2$">>`>
    <$action-createtiddler $basetitle=<<title>> tags=<<selector>> >
      <$action-navigate $to=<<createTiddler-title>>/>
    </$action-createtiddler>
  </$wikify>
  \end new-tiddler

<$button actions=<<new-tiddler>> >
{{$:/core/images/plus-button}} <<selector>>
</$button>
\end

I want to extend this possibility also to clone a tiddler and using the separator and read this information here:

  1. Cloning a tiddler - Discussion - Talk TW
  2. How do I clone a tiddler while giving it a new title? - Discussion - Talk TW

I tried to implement the solution <$action-sendmessage $message="tm-new-tiddler" $param=<<list-item>> title="new title" /> instead of <$action-createtiddler $basetitle=<<title>> tags=<<selector>> >
by replacing $param with title but don’t get the expected result.
What I want is a 100% clone of the tiddler but with a seperator as parameter instead of the space.

\procedure clone-entry(selector, sep)

  \procedure new-tiddler()
    <$wikify name="title" text=`<<unusedtitle baseName:"$(selector)$" separator:"$(sep)$" startCount:"01" template:"$basename$$separator$$count:2$">>`>
<!--
    <$action-createtiddler $basetitle=<<title>> tags=<<selector>> >
-->
    <$action-sendmessage $message="tm-new-tiddler" $param=<<title>>  />
      <$action-navigate $to=<<createTiddler-title>>/>
    </$action-createtiddler>
  </$wikify>
  \end new-tiddler

<$button actions=<<new-tiddler>> >
{{$:/core/images/plus-button}} <<selector>>
</$button>
\end

Thank you for any help and support

Stefan

See the docs: 4th example

The template-tiddler should be replaced by the tiddler title, which should be cloned.

\procedure clone-entry(selector, sep)

  \procedure new-tiddler()
    <$wikify name="title" text=`<<unusedtitle baseName:"$(selector)$" separator:"$(sep)$" startCount:"01" template:"$basename$$separator$$count:2$">>`>

    <$action-createtiddler $basetitle=<<title>> $template="template-tiddler" tags=<<selector>> >
      <$action-navigate $to=<<createTiddler-title>>/>
    </$action-createtiddler>

  </$wikify>
  \end new-tiddler

<$button actions=<<new-tiddler>> >
{{$:/core/images/plus-button}} <<selector>>
</$button>
\end

Hi @pmario,

Thank you for the hint.
I checked the documentation and exchanged the "template-tiddler" with <<currentTiddler>> because the procedure will be called from different other tiddlers and I want to clone them.
But it is doing nothing :frowning:

\procedure clone-entry(selector, sep)

  \procedure new-tiddler()
    <$wikify name="title" text=`<<unusedtitle baseName:"$(selector)$" separator:"$(sep)$" startCount:"01" template:"$basename$$separator$$count:2$">>`>

    <$action-createtiddler $basetitle=<<title>> $template=<<currentTiddler>> tags=<<selector>> >
      <$action-navigate $to=<<createTiddler-title>>/>
    </$action-createtiddler>

  </$wikify>
  \end new-tiddler

<$button actions=<<new-tiddler>> >
{{$:/core/images/plus-button}} Clone this <<currentTiddler>>
</$button>
\end

Any idea why it is still not cloning?
Stefan

I did test it with tiddlywiki.com and it works as expected.

Hi @pmario,

too much clones from the procedure in the wiki.
I found a second Tiddler with the procedure “clone-entry” from a former failed test. :frowning:

Mea culpa
Stefan