Hello,
First, there were some lexical mistakes in your text. Maybe the UTF got
mangled by copy/paste?
Second, I'm not sure if you can actually define a macro inside a macro.
I've always kept definitions separate. So, humor me, I separated them.
Finally, whenever I find that literal text is popping up where I expect
transcluded (wikified) text, I'm pretty sure I need the <$set> to set up
the variables for me.
The code below is what came up with. I ditched the <<tmp>> macro since it
didn't seem to be doing anything. The following code seems to work.
Good luck!
Mark
*\define newtitlemacro() {{$:/temp/newtitle}} <<now YY-MM-DD>>*
*\define newtitlemacro() $(mytitle)$ $(rightnow)$*
*\define newentry()*
*<$button>*
*<$action-sendmessage $message="tm-new-tiddler" title=<<newtitlemacro>>
description=<<now "ddd, mmm DD, YYYY - 0hh:0mm $(currentTiddler)$">>
tags="BM GL [[Hello World]]"/>*
*New Entry:*
*</$button>*
*<$edit-text tiddler="$:/temp/newtitle" tag="input" default=""/>*
*\end *
*<$set name="rightnow" value=<<now YY-MM-DD>> >*
*<$set name="mytitle" value={{$:/temp/newtitle}} >*
*<<newentry>>*
*</$set></$set>*
On Friday, October 9, 2015 at 10:05:58 AM UTC-7, brorgschlr85 wrote:
>
> I am trying to create a button with an accompanying edit-text widget that
> will (a) create a new tiddler with the title entered in the edit-text
> widget box, (b) edit the description field of the new tiddler as specified
> below, (c) assign multiple tags to the new tiddler (as below), and (d)
> append the current date to the title of the new tiddler.
>
> The following macro achieves objective (a) through (c):
>
> \define newentry()
>> \define tmp() {{$:/temp/newtitle}} <<now>>
>> <$button>
>> <$action-sendmessage $message="tm-new-tiddler" title={{$:/temp/newtitle}}
>> description=<<now "ddd, mmm DD, YYYY - 0hh:0mm $(currentTiddler)$">>
>> tags="BM GL [[Hello World]]"/>
>> New Entry:
>> </$button>
>> <$edit-text tiddler="$:/temp/newtitle" tag="input" default=""/>
>> \end
>
>
> However, (d) is proving very difficult. I've tried passing a macro to the
> title attribute of the action-sendmessage widget, but the result is the
> literal string of the macro call, e.g.:
>
> \define newentry()
>> \define newtitlemacro() {{:/tempnewtitle}} <<now YY-MM-DD>>
>> \define tmp() {{$:/temp/newtitle}} <<now>>
>> <$button>
>> <$action-sendmessage $message="tm-new-tiddler" title=<<newtitlemaro>>
>> description=<<now "ddd, mmm DD, YYYY - 0hh:0mm $(currentTiddler)$">>
>> tags="BM GL [[Hello World]]"/>
>> New Entry:
>> </$button>
>> <$edit-text tiddler="$:/temp/newtitle" tag="input" default=""/>
>> \end
>
>
> but the resulting button/text field creates a new macro entitled
> "<<newtitlemacro>>"). As seen above, I'm able to pass macros to the
> description attribute of the action-sendmessage widget, so I'm not sure why
> the title attribute takes literal strings only.
>
--
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/20eb59bd-005a-4bdd-98e6-e070f2744d6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.