On Apr 1, 2:10 am, geert Geurts <[email protected]> wrote:
> Hello,
> I'm using tiddly wiki allot for my work, and I use the forEachTiddler plugin
> to organize my work.
> Does anyone know of a way to make the forEachTiddler plugin able to make a
> list of all tiddlers which have a tag that starts with "project", for
> instance?

Using a 'script' clause in your fET macro, you can define an Array
prototype function that, given an array of strings (i.e., the 'tags'
of a tiddler), returns a subset of the array containing only those
strings that start with specified text:

script '
   Array.prototype.startsWith=function(txt) {
      var out=[];
      for (var i=0;i<tiddler.tags.length;i++)
         if (tiddler.tags[i].substr(0,txt.length)==txt)
            out.push(tiddler.tags[i]);
      return out;
   }
'

Then, to test for the desired matching tags in the fET conditional,
you can write:
   'tiddler.tags.startsWith("project").length > 0'

note: untested code

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