I’m setting up a new dashboard for a book chapter I promised to write. The first draft is due on January 17, and I’m feeling a little nervous about that: the chapter is showing an alarming tendency to grow.
So I added a dashboard note with the following rule*:
I’m recording business mileage details in a dashboard container. The $Name of the container is the year and the $Subtitle is the total mileage expense for the year.
The children in the container are all of my individual car trips for the year, where I record mileage along with other business related attributes. Mileage expense for each trip is automatically calculated based on the allowed mileage rate for the year.
Here are my relevant dashboard container rules for 2021:
I think this is a really good idea for a Task prototype.
In my pTask prototype I currently have the following rule: $Subtitle=$CompletionScore +"% Complete" which works with a bar Plot to change the colour of my task notes depending on how far along the completion path I am with that task. (set Pattern to “bar” and Expression to '$CompletionScore" where $CompletionScore is an attribute of that prototype)
The problem with my approach is that the $Subtitle should be across 2 lines, and it’s currently on one line. Any suggestions on how to insert a line break in the $Subtitle after “% Complete”?
Thanks
Here is a small update - the parameters for the weather API are now attributes of a prototype ($WeatherAPI and $WeatherCity). Then you could add individual notes and change the attribute $WeatherParam to retrieve any of the values delivered by the API (temp, …):
A way to solve this is to have one note — perhaps /config/Weather — send the request. That note can parse out all the weather information you need, and other notes simply ask it for what they want.
$Subtitle=$Humidity(/config/Weather)
Alternatively, the config note could be responsible solely for downloading the json, and each note that wants to do weather could get the json from $MyString(/config/Weather) and extract what it needs.
This is very cool, and I’ve been able to create an account, obtain an API authorization, looked up my city code, and I’m getting local data in the dashboard. That is, it worked.
I changed units to imperial, because they’re what I’m accustomed to, though metric in pressure is equally as familiar. "Hg is just quaint.
But… I could not figure out for the life of me how you’re populating the $Subtitle attribute with the returned data.
I saw you’re using $AutoFetchCommand, and that’s setting a variable, “myRegExTerm” equal to the result of some regular expression magic. That’s ALL you can see in the Attribute Browser, and there is nothing in the Action Inspector. In the Attribute Browser, there is an ellipsis following the regex statement. On a hunch, I clicked on the attribute, which highlighted it and I copied it and pasted it into a note, where I found this (I don’t see an icon to cause this to display as code):
I understand everything in this except the $1. I don’t know what that is.
And to @eastgate, what am I missing in terms of being able to find the entire action code of the $AutoFetchCommand? I’m sure there’s something I’ve overlooked.
Thanks! This is very cool and an excellent use case for learning about a neat feature of Tinderbox.
After a regular expression has been matched, Tinderbox sets a number of local variables that are available to the rest of the action.
$0 : the matched string
$1 : the first matched backreference
$2 : the second matched back reference
For string attributes longer than a displayed expression table, you can click to edit and then use the arrow keys, home and end keys, and so forth to examine them. Or copy the whole thing and paste in some convenient place, such as the text of a note. Some people like to compose in a note and then use a rule to move the text to the action attribute.
Thanks! Yes, the ellipsis was the essential clue. Didn’t think of arrowing over the text, but the ellipsis and the highlight made me think of “copy.” Noted for “best practices” purposes.