On Thursday, October 24, 2013 2:04:02 PM UTC-7, Jan wrote:

> Here's the problem: 
> Creating a macrobutton: 
> <<newSavedTiddler 
>          label:"Save this Story" 
>          text:{{store.getTiddlerText('SaveStoryTemplateTiddler')}} 
>          tag:'MyTag1 [[Three Word Tag]]' 
>  >> 
> ...and a SaveStoryTemplateTiddler 
> <script> 
> var out = "" ; 
> story.forEachTiddler(function(t){ 
>     var tid=store.getTiddler(t); 
>      if(tid&&!tid.isTagged("excludeStory")) 
>        out+="[["+t+"]]\n";}) 
> return out ; 
> </script> 
> <<openStory {{tiddler.title}} "Open this Story" "Display all the 
> tiddlers listed above...">> 
>
> Now problem is: 
> The script should be rendered to save the current storyline as static 
> links, not to display the one actually opened on a later moment. 
> How do I accomplish this. 
> Is there something like "clickyfy" for this cause...? 
>

Using http://www.TiddlyTools.com/#ClickifyPlugin, you can write the script 
directly into the newTiddler macro, like this:

<<clickify newSavedTiddler 
      label:'Save this Story'
      text:{{
         var out='';
         story.forEachTiddler(function(t){
            var tid=store.getTiddler(t);
            if(tid&&!tid.isTagged('excludeStory'))
               out+='[['+t+']]\n';});
         out+='<<openStory [['+tiddler.title+']] "Open this Story" "Display 
all the tiddlers listed above...">\>' 
         out;
      }} 
      tag:'MyTag1 [[Three Word Tag]]' 
 >>

Notes:
* by using ClickifyPlugin, the evaluated "text:" parameter is recalculated 
when you click on the 'Save this Story' command label.
* when macro syntax is embedded within evaluated parameter script code, 
e.g., use of "<<openStory ... >>" as a text string, you must insert a 
backslash (\) in between the closing angle brackets of the embedded macro 
-- i.e., ">>" becomes ">\>" -- so that the closing ">>" of the embedded 
macro does not erroneously appear to be the end of the entire macro being 
invoked, rather than just a simple bit of text within the scripted code.
* the last line of the evaluated parameter retrieves the value of "out" 
without performing any other action. This allows the value to be used as 
the final value of the evaluated parameter as a whole.

Let me know how it goes...

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 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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to