Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How to get evaluation to work in tiddler macro?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Mark S.  
View profile  
 More options Jul 5, 4:15 pm
From: "Mark S." <throa...@yahoo.com>
Date: Sun, 5 Jul 2009 13:15:21 -0700 (PDT)
Local: Sun, Jul 5 2009 4:15 pm
Subject: How to get evaluation to work in tiddler macro?
I have the ExternalTiddlerPlugin installed. I'm trying to get the
tiddler macro to evaluate the contents of a separate tiddler in order
to determine what tiddler will be imported. Here's what I have tried
so far:

 <<tiddler    {{"return store.getTiddlerSlice('PagePick','page')+'#3'
"}} >>
 <<tiddler  {{"store.getTiddlerSlice('PagePick','page')+'#3' ; "}} >>
 <<tiddler  [[PagePick::page]]#3  >>

I've tried other versions. None of these have worked so far. As a
check, I ran the script:

<script>
return store.getTiddlerSlice('PagePick','page')+'#3'  ;
</script>

and it returns the correct response:
  killthis.html#3

And yes, "killthis.html" exists in the same directory, and has a
tiddler called "3".

In fact, I can do exactly what I want if I construct the macro on the
fly like:

<script>
return "<<tiddler " + store.getTiddlerSlice('PagePick','page')+'#3'  +
" >>" ;
</script>

But somehow that seems clumsier than it ought to be.

Thanks in advance,
Mark


    Reply to author    Forward  
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.
Eric Shulman  
View profile  
 More options Jul 5, 9:03 pm
From: Eric Shulman <elsdes...@gmail.com>
Date: Sun, 5 Jul 2009 18:03:03 -0700 (PDT)
Local: Sun, Jul 5 2009 9:03 pm
Subject: Re: How to get evaluation to work in tiddler macro?

> tiddler macro to evaluate the contents of a separate tiddler in order
> to determine what tiddler will be imported
>  <<tiddler  {{"store.getTiddlerSlice('PagePick','page')+'#3' ; "}} >>

You were very close!

The use of the trailing '' in the above code snippet forces the result
to be a blank string so that the computed parameter can evaluated
*without* producing any macro output, as a way to invoke tiny bits of
javascript without using InlineJavascriptPlugin. However, for your
purposes, you *do* want to produce output from the <<tiddler>> macro,
so you need to get rid of the trailing '' in order for the correct
param value to be applied.  Thus:

<<tiddler  {{"store.getTiddlerSlice('PagePick','page')+'#3'}} >>

enjoy,
-e


    Reply to author    Forward  
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.
Eric Shulman  
View profile  
 More options Jul 5, 9:04 pm
From: Eric Shulman <elsdes...@gmail.com>
Date: Sun, 5 Jul 2009 18:04:37 -0700 (PDT)
Local: Sun, Jul 5 2009 9:04 pm
Subject: Re: How to get evaluation to work in tiddler macro?
errata:

there was an extra leading quote that needed to be removed as well...
thus:

<<tiddler  {{store.getTiddlerSlice('PagePick','page')+'#3'}}>>

-e


    Reply to author    Forward  
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.
Mark S.  
View profile  
 More options Jul 6, 1:19 am
From: "Mark S." <throa...@yahoo.com>
Date: Sun, 5 Jul 2009 22:19:10 -0700 (PDT)
Local: Mon, Jul 6 2009 1:19 am
Subject: Re: How to get evaluation to work in tiddler macro?
Hi Eric,

Thanks for the help! I think what you're saying is that if there is
any space in the input scriptlet, then the parser will think you are
starting a new parameter and discard the previous one as incomplete.
Or?

Now that I have it working, I realize that the ExternalTiddlerPlugin
doesn't seem to allow me to dive down one directory, with a relative
path like this:

  <<tiddler directory/targetfile.html#1 >>

or with any other path I've tried. Is this a typical safety protocol,
or is there some formulation of path that will allow this to happen?

Many thanks again!
Mark

On Jul 5, 5:04 pm, Eric Shulman <elsdes...@gmail.com> wrote:


    Reply to author    Forward  
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.
End of messages
« Back to Discussions « Newer topic     Older topic »

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google