Yes, that works.
I do not need them to be formatted in a table but I may fiddle with that option just to see how it works. Thanks, Mark! On May 1, 10:41 am, "Mark S." <[email protected]> wrote: > As long as your output text starts with the author name, you should be > able to get the results sorted by putting this just before the return > statement: > > out.sort() ; > > If you suddenly decide you want to sort by some other field (slice), > then either you would need to make that field the start of each output > line, or you would need to rewrite the code a bit to store away each > tiddler's data as an array instead of a string, then sort the array by > passing the sort method a sort function, then iterate over the output > array to build the formatted output. > > If your output happens to be formatted as a table, then you could use > Eric's table-sorting plugin and the entire table will then be > instantly sortable by any column you choose. This is probably the > easiest and most flexible solution. > > -- Mark > > On Apr 30, 1:35 pm, mck <[email protected]> wrote: > > > Thanks for the script! > > > Is there a way to get this to sort by author? > > > I found that I can tweak the EndNote APA style: > > > BOOK: > > `|`author`|`Author`|` > > `|`year`|`(Year)`|` > > `|`title`|`Title`|` > > `|`(Translator, Trans.)`|` > > `|`city`|`City`|` > > `|`publisher`|`Publisher`|` > > > to get EndNote to output the slices: > > > |author|Goble, P.| > > |year|(1980)| > > |title|The gift of the sacred dog: story and illustrations| > > |place|Scarsdale, N.Y.| > > |publisher|Bradbury Press| > > > <script> > > var out=[]; > > var fmt='%0 //[[%1]]//. %2. %3, %4<br>'; > > var tids=store.getTaggedTiddlers('DogsFolklore'); > > for (var i=0; i<tids.length; i++) { var t=tids[i].title; > > var val1=store.getTiddlerSlice(t,'author') > > var val2=store.getTiddlerSlice(t,'title') > > var val3=store.getTiddlerSlice(t,'city') > > var val4=store.getTiddlerSlice(t,'publisher') > > var val5=store.getTiddlerSlice(t,'year') > > out.push(fmt.format([val1,val2,val3,val4,val5])); > > } > > return out.join('\n'); > > </script> > > > Bibliography: > > > Goble, P. [[The gift of the sacred dog: story and illustrations]]. > > Scarsdale, N.Y.. Bradbury Press, (1980). > > > This is nice. > > > Now, if I had several such books tagged DogsFolklore, is there a way > > to change the inline script so that the resulting bibliography is > > sorted by author? > > > On Apr 28, 8:21 pm, Eric Shulman <[email protected]> wrote: > > > > > I've started working on a plugin that will grab tiddlers that match a > > > > tag, and then grab the slices out of them and format per a format > > > > string (typically into a table). It occurs to me that maybe this > > > > already exists. Is there a plugin like this already out there? > > > > You can do this very easily using > > > http://www.TiddlyTools.com/#InlineJavascriptPlugin > > > > <script> > > > var out=[]; > > > var fmt='|%0|%1|%2|'; > > > var tids=store.getTaggedTiddlers('someTag'); > > > for (var i=0; i<tids.length; i++) { var t=tids[i].title; > > > var val1=store.getTiddlerSlice(t,'SomeSlice1') > > > var val2=store.getTiddlerSlice(t,'SomeSlice2') > > > var val3=store.getTiddlerSlice(t,'SomeSlice3') > > > out.push(fmt.format([val1,val2,val3])); > > > } > > > return out.join('\n'); > > > </script> > > > > Note: if you want to apply more complex boolean logic to the tag- > > > selection criteria, you can also install > > > http://www.TiddlyTools.com/#MatchTagsPlugin > > > and then replace this line of the above script: > > > var tids=store.getTaggedTiddlers('someTag'); > > > with something like this: > > > var tids=store.getMatchingTiddlers('someTag or someOtherTag and not > > > somethingElse'); > > > > 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 -~----------~----~----~----~------~----~------~--~---

