Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Inserting the variable of another Tiddler content into a Macro...or using a macro in a macro....
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eric Shulman  
View profile  
 More options Nov 10 2012, 8:15 am
From: Eric Shulman <elsdes...@gmail.com>
Date: Sat, 10 Nov 2012 05:15:25 -0800 (PST)
Local: Sat, Nov 10 2012 8:15 am
Subject: Re: Inserting the variable of another Tiddler content into a Macro...or using a macro in a macro....

> The saveStoryButton will be placed on the Menu. The advantage the
> newTiddlerPlugin compared to saveStory would be, that it is possible to
> created the new StoryTiddler in editMode with the focus set on the
> title, to make the users change the storyname immediately.  I would even
> like bette to have a prompt saying " insert a name for your new tiddler
> here"

Except for changing the storyname, it's not clear to me what advantage
there is in opening the newly created story tiddler in edit mode...
and, you *can* use <<saveStory>> to "prompt for tiddlername" with the
'ask' option:
    <<saveStory ask "label" "helptext" tag tag tag...>>

Note also that your approach -- generating a <<newTiddler>> macro --
won't actually achieve the results you want, for one very important
reason: the list of tiddlers that are open when you *generate and
render* the <<newTiddler>> macro will almost certainly be different
from the tiddlers that are open when you later *click* on the rendered
menu link.  Because the <<newTiddler>> macro's parameters are not
generated when you click, it will always create a story using the same
initial set of open tiddlers, rather than the *currently* open set.

Fortunately, there is a solution for this type of problem:
   http://www.TiddlyTools.com/#ClickifyPlugin
allows you to re-calculate macro parameters whenever a rendered
command is clicked.  You simply install the plugin and then add
"clickify" to the front of the macro call.

For your purposes, you can completely skip the <<forEachTiddler>>
action, and use "evaluated parameters" with <<newTiddler>> to generate
the list of open tiddlers.  You can also prompt for a story name at
the same time!

Something like this:

<<clickify newTiddler
   label:Test focus:title tag:hinzugef gt tag:stunde
   title:{{prompt('enter a new story name','MyNewStory')}}
   text:{{
      var out="";
      story.forEachTiddler(function(t){out+="[["+t+"]]\n";});
      out;
   }}


To generate the list of open tiddlers, the text:{{...}} parameter
defines an empty output variable, then appends tiddlers titles, and
then references that output variable as the last statement processed
within the code, so that the resulting list of titles is "returned" as
the parameter value.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://www.TiddlyTools.com/#Donations

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.