Main menu:

Twittering


follow mhanlon at http://twitter.com

Reading (AllConsuming)

Read (Also AllConsuming)

Site search

Categories

Archive

Dashboarding

Right, it’s been a while… how does this work again? Right. Anyway.

I’ve been following Mark Bernstein’s posts on building a dashboard in Tinderbox and enjoying them… and puzzling out how to implement them, in a lot of cases.

One thing I wanted to do, once I figured out how the example he gave in the post above worked, was not have to type in all the random words I wanted as notes in a note in my Tinderbox file.

So what I did was use Tinderbox’s ability to run command line to grab a random word out of the built-in system dictionary. I couldn’t quite get the perl one-liner working inline, so what I did was I created a file called randomWord and put the following in it:

#!/bin/sh

word=`perl -e 'open IN, "</usr/share/dict/words";rand($.) < 1 && ($n=$_) while <IN>;print $n'`

echo $word
I made it executable and dumped it in /usr/bin.
Then, in my Word of the Day note in Tinderbox, I added the following in the Rule section of the note (modified slightly from Mark’s example – visible when you right-click on a note and choose to the Rename menu item):
if($Date!="today") {
 $Text=runCommand("randomWord", "");date="today";}
And I was done. A daily word of the day from the built-in dictionary… now to just find the time to write in that Tinderbox file everyday…

Write a comment