It has taken me longer to put together this third installment of my Tinderbox Chronicles than I had intended (look at part 1 and part 2 for the other installments). As I began writing about actions and attributes, I found myself drifting dangerously into the realm of tutorial, and with an application as rich and feature-packed as Tinderbox that can be very dangerous. If I don’t watch out, I could easily find myself mired in this project for months.
So I have decided to take you through one project that demonstrates some of Tinderbox’s strengths, and show how agents and actions work.
I work for a small, nonprofit publisher of books about sexual abuse. For a recent meeting, I wanted to create a visual representation of our catalog of titles, showing how old our books are by the type of book. The first step was grabbing title, ISBN, price, author and other information on each of our publications which I already had in a spreadsheet on my work PC (transfered to my MacBook via Dropbox). I then opened a spreadsheet in Numbers (the Apple iWorks spreadsheet).
The next step demonstrates one of Tinderbox’s cool features.
I selected and copied all the cells of the spreadsheet, including the headings of the columns. Then I just pasted this information into an open map in Tinderbox, which created a new item and populated this item with a sub item for each of the rows in the spreadsheet. But wait, there’s more. Tinderbox also automatically created attributes for each of the top row headings, made these key attributes and added the information from the spreadsheet.
Here are some screen captures to show you what I mean:
(Two notes regarding the spreadsheet import: 1. Tinderbox will only execute this properly if every cell contains content, so even if I have no data for a cell, I just add “n/a”. 2. The fact that the items in the first screen capture are arranged in columns and rows is incidental, and is not indicative of the spreadsheet from which they came — I don’t want to give the mistaken impression that my spreadsheet is duplicated in Tinderbox.)
So now I have my data on board. Let’s make some sense of it.
I want to color each title based upon how old it is, breaking our catalog into three groups: new, moderate and old. Book age is one of the key attributes imported with the spreadsheet, so this is easy to do using agents. First, I will create an agent to turn all new titles blue. I tell it which notes to act on, then tell it what that action should be.
Again, this is not a tutorial, so I won’t go into too much detail about the procedure, but notice that there is a query that basically says that for the key attribute “Book_Age” look for those that say “up to 4″. Then there is an action that says to turn the color to blue; ; i.e. $Color=“blue” (Tinderbox is very sensitive, which I find a little frustrating as I fiddle with the syntax to get it to actually do what I want).
After I create the other two agents (green for moderate, warm gray for old titles), my map now looks like this:
Now I have a quick visual guide to the age of our books… looks like we need to add some new titles! (Those larger boxes are the agents — which have also captured clones of the originals, and displays them as sub-items.)
Next I want to break the catalog down into the three types of books we publish: workbooks, professional books and books for lay people. To accomplish this, I create adornments with queries that will “suck” in the appropriate titles. Adding queries to adornments is similar to creating queries for agents. I create one adornment for each of the three types, and it looks like this:
Of course, I could have done this by manually dragging each note onto the appropriate adornment, but this is much faster and far more fun.
In this post I’ve introduced the notion of agents and re-examined adornments. At first blush adornments and agents can seem similar, which they are. But there are crucial differences. An adornment remains a decorative embellishment, a superficial visual container. An agent is more pro-active, going out and hunting for notes that meet its query rules. It acts on the notes, and, optionally collects clones (or aliases, in Tinderbox parlance). With these tools, which are easy to learn (other than I had to fidget with the syntax in adornments and agents), I was able to quickly create a map that shows me the ages of our book titles by type. And, as the creator of Tinderbox would say, this is only the starting point.