I am currently using Tinderbox to manage some large creative projects for myself.
One of these projects has several containers organized by what I need to research and do. As I work on my notes, I need to make some of them into tasks. I drag notes out of their original containers into my “Next-up Tasks” container which has the AddAction of turning the note light red and setting the start date to today, the current date on which I put the note into the container. In the inspector I have entered:
$Color=#D182A0;$StartDate=“today”;
which works great. The note changes color and I can easily see the correct position of the note in timeline view.
But when I put my notes in the container, I also want the StartDate to show in the title of the note so I can see it. It would be nice not to have to manually type in the start date on each note added.
I have searched the manual, online help, this forum and have read the Tinderbox Way, but really am not seeing or figuring how to do this.
If I’ve understood your situation correctly I think $DisplayExpression will achieve what you are looking for. Using a prototype, set its $DisplayExpression to a string incorporating $StartDate
hi, sorry to reopen an old conversation but it seemed better than starting a new one: I am trying to have a note display the startdate (or another date attribute) in the l or L format, followed by the Name, but don’t seem to be able to crack it. I am sure it’s simple, but the one above only throws up a full date+time (and I haven’t managed to figure out how to swap the attributes so the date comes first. Could you help? Thanks!
This leaves $Name untouched. So note “Project X” retains that $Name but the visible title ($DisplayName) becomes 14/08/2020 Project X. The latter is as on my UK (dd/mm/yyyy) OS - other locales may show the date differently. The character(s) in quotes in the .format() above set the date format - see date format designators.
The example above is to set a Display Expression via code. The result, or if typed into the Title Inspector manually is like this:
[sorry - cross-posted on top of @PaulWalters’ solution, but our suggestion is the same!]
The forum software turns straight quotes into curly ones†. Can you confirm that unlike your code as posted, i.e. …
$StartDate.format(“y-M0-D”)+" "+$Name;
Your code is actually:
$StartDate.format("y-M0-D")+" "+$Name;
The first will fail as curly quotes aren’t treated as string delimiters by action code. Anyway, if we can confirm this isn’t the issue before looking further.
†. To make code samples render as monospace & without quote style auto-correction do any one of:
Select the code and click the </> button in the toolbar for the message drafting box.
Put a single back-tick ` symbol immediately before and after the code sample.
For multi-line sample or where you’d like a form of syntac colouring, put a series of three back-ticks ( ``` ) on a line of their own both before and after your code sample (this is the method I’ve use above here in this post)