Hmm..

I'm trying and trying again - but I can't make it work...
Last try was:
 var t=store.getTiddlerText('tiddler.title') ;
   var target = store.getTiddler('tiddler.title') ;
Response was TypeError t is null...

If I'm going to put all the text from your "guaranteed to work code" -
How am I to distribute the text inside the existing code?

<script label="L2T" title="List2Tags">
   var t=store.getTiddlerText('source tiddlertitle','');
   var target = store.getTiddler('target tiddlertitle') ;
   var taglist = t.split('\n') ;
   for(var i=0 ; i < taglist.length ; i++) {
    if ( taglist[i] && ! target.tags.contains(taglist[i]) )
target.tags.push( taglist[i] ) ;
   }
  return 'List 2 tags Done - Now click edit and finish in
targettiddler to make the tags active' ;
</script>

YS Måns Mårtensson

On 12 Apr., 07:43, Eric Shulman <[email protected]> wrote:
> > It would suffice if I could refer to the tiddler in which the toolbar
> > is active..
> > none of these works:
> > {{tiddler.title}} '+tiddler.title+'
> > What can i write instead of:
> >  var t=store.getTiddlerText('Source tiddlertitle','');
> >    var target = store.getTiddler('Source tiddlertitle') ;
>
> You can find the current tiddler object like this:
>
>    var here=store.findContainingTiddler(place); // tiddler DOM element
>    if (!here) return; // not in a tiddler
>    var title=here.getAttribute("tiddler"); // attribute holds title of
> tiddler
>    var tiddler=store.getTiddler(title);
>
> (in your case, you just want the title, so skip the last line).
>
> Although the above code is guaranteed to always work, it's somewhat
> inconvenient and 'bulky'.
>
> However, inline scripting normally has access to a core-defined
> variable, 'tiddler' that holds a reference to the current tiddler
> object, so simple references like 'tiddler.title' are supposed to work
> when processing inline scripts.
>
> Unfortunately, even though 'tiddler.title' can be used in a regular
> inline script, it wasn't working properly when used in an 'onclick'
> scripts, because they aren't invoked until the link is actually
> clicked upon, which can occur long after the tiddler in which the
> script occurs has been rendered.
>
> Fortunately, I've fixed this... get the update (v1.9.5) here:
>    http://www.TiddlyTools.com/#InlineJavascriptPlugin
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to