Action-send-message new tiddler question

73 views
Skip to first unread message

David Gifford

unread,
Jan 27, 2020, 10:03:44 AM1/27/20
to TiddlyWiki
Okay I am getting excited about my Roam-y adaptation, and this is one of the last pieces of the puzzle.

I did this for a 'new journal here' clone.

<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> text="<<currentTiddler>>" />

It creates a new tiddler that puts the parent tiddler's title in the text of the child tiddler.

But I would really like that to be a link rather than just plain text. How could I do that?

David Gifford

unread,
Jan 27, 2020, 10:40:50 AM1/27/20
to TiddlyWiki
I accidentally had quotes around <<currentTiddler>>. What I should have posted is below. I want to do this, but have the current tiddler title show up as a link: [[name of parent tiddler]]

<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> text=<<currentTiddler>> />

Hubert

unread,
Jan 27, 2020, 11:13:07 AM1/27/20
to TiddlyWiki
Hi David,

I'm sure others will suggest a more elegant (and shorter) solution, but this is one way you could do that (using the $wikify widget):

\define button()
<$button actions=<<actions>>>
click
</$button>
\end

\define actions()
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> text="""[[$(tid)$]]"""/
>
\end

<$wikify name=tid text=<<currentTiddler>>>
<<button>>
</$wikify>

Regards,
Hubert

David Gifford

unread,
Jan 27, 2020, 3:19:53 PM1/27/20
to TiddlyWiki
Hi Hubert!

I used your code and figured out how to integrate it into the new journal buttons. Thought I had written earlier to thank you. Thanks a bunch!

Eric Shulman

unread,
Jan 27, 2020, 4:03:35 PM1/27/20
to TiddlyWiki
On Monday, January 27, 2020 at 8:13:07 AM UTC-8, Hubert wrote:
I'm sure others will suggest a more elegant (and shorter) solution...

No need to use $wikify.  Since <<currentTiddler>> is already defined as a variable, you can use $(currentTiddler)$ inside the macro, like this: 

\define journalButton()
<$button> click
   
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> text="""[[$(currentTiddler)$]]"""/>
</$button>
\end

<<journalButton>>

enjoy,
-e

Reply all
Reply to author
Forward
0 new messages