Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1 2 
Send Topic Print
Creating a journal with name=date created (Read 15723 times)
Derek Van Ittersum
Full Member
*
Offline



Posts: 168

Creating a journal with name=date created
Aug 11th, 2009, 4:30pm
 
Hi everyone,

With the recent posts about noguchi shelving, I've become interested in creating a daily work journal with Tinderbox.  The example from Loryn was inspirational, but not exactly what I needed.  I've devised a system that I think will work great, which I'll describe below, but to cut to the chase, I'm at the end of my Tinderbox knowledge on a particular "rule."  I created a prototype (daily) that applies to all daily log notes.  This prototype does several things: gives key attributes (date created, modified, and my own "project" attribute) and I'd also like to make it assign the name of the note the date it was created.  I put this expression (culled from a web search) as its rule:  

Name=^Get(Created,"m/d/y - h:mm:s")

Unfortunately, this also names my prototype by the date created, which is a problem.  I'm looking for a way to make all daily journal entries named by their created date--are there better options?

So, here is the system as I currently have it:

The "shelf", a container into which all incoming notes go, reverse sorted by date modified.

Then, a series of agents:

Project Logs: one agent each for each project, finds notes by matching the name of the "project" attribute (a set).

Daily Journal: an agent that displays all notes tagged with the prototype "daily". This is the agent that breaks when I make the prototype as described above, since the name changes to the date, instead of "daily."

Here is the workflow:  all new notes are created as children of the "shelf" container.  Some notes are ideas, plans, etc.  Other notes are specific, end of the day, journal entries.  As each of these notes goes into the shelf, agents collect them into the assigned projects (according to the terms listed in the "project" attribute) and puts the daily journal items into that agent.  This way discrete notes/tasks/plans/etc. are separated from the journal itself.  

I'm trying to start simple, and let more complex structure evolve as I use the journal (and find more uses for it).  

Hopefully the question is not too buried in this overly-detailed post, but I was thinking it may be of use to others.  Thanks in advance for any advice!

derek
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Creating a journal with name=date created
Reply #1 - Aug 11th, 2009, 5:36pm
 
Instead of setting the name, try using the DisplayExpression field to change the way the name is displayed. For example, a DisplayExpression of

    $Name+":"+format($Created,"l")

will display

    Visiting Yosemite:May 7, 2008
Back to top
 
 
WWW   IP Logged
Derek Van Ittersum
Full Member
*
Offline



Posts: 168

Re: Creating a journal with name=date created
Reply #2 - Aug 12th, 2009, 10:15am
 
Thanks Mark.  Your suggestion helped me construct a working rule:

$Name="Journal"+": "+format($Created,"m/d/y - h:mm")

I didn't want to have to set the name because thinking of a discrete title for each journal entry seemed too taxing.  With this correct syntax, everything's working fine.
Back to top
 
 
  IP Logged
Jean Goodwin
Full Member
*
Offline



Posts: 136
North Carolina
Re: Creating a journal with name=date created
Reply #3 - Aug 12th, 2009, 12:37pm
 
I get worried that rules can slow down processing once you have hundreds of notes--someone else can comment on this, I'm sure.

Since the Name you want to assign won't be changing after the note is created, another option might be to set the OnAdd action for the Shelf container which sets the Prototype and also the Name by the formula you've devised.  That will affect only the notes you write--not the prototype stored elsewhere.

There are a lot of great ideas & tips out there for using Tinderbox as a daybook--you might try both a forum and a google search.  I've never been a diarist myself (I'm boring), but I got inspired by some discussion a while back and am now tracking various things.  As usual, Tinderbox is lightweight/unobtrusive, expandable/customizable, and powerful.  Have fun!
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Creating a journal with name=date created
Reply #4 - Aug 12th, 2009, 12:54pm
 
Another option would be

   Name |= ....

This means, "set the name only if it's empty"
Back to top
 
 
WWW   IP Logged
Derek Van Ittersum
Full Member
*
Offline



Posts: 168

Re: Creating a journal with name=date created
Reply #5 - Aug 12th, 2009, 1:30pm
 
Thanks for the tips.  As you might be able to tell, I'm really trying to go the whole "learn features as you need them" route.  I don't have any experience with programming, so all these expressions and logic rules are beyond my basic google/boolean skills.  The manuals/wiki/forum etc. are useful, but dense, so it takes a while for things to sink in.

At any rate, I really appreciate the responsiveness on this forum.  Some forums can be resistant to novices (RTFM attitude, etc.), but this place is great.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Creating a journal with name=date created
Reply #6 - Aug 12th, 2009, 1:36pm
 
Also consider a self-cancelling rule as a way to use a rule that will only run once. (The idea was Mark B's, not mine).
Back to top
 
« Last Edit: Aug 12th, 2009, 1:36pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Ioa Petra-ka
Full Member
*
Offline



Posts: 103
Portland, Oregon, USA
Re: Creating a journal with name=date created
Reply #7 - Dec 28th, 2009, 6:08pm
 
You'll want to add an exclusion for prototypes if you intend to use self-destructing rules, however. A simple example would be:

Code:
 $Name = "Journal: " + format($Created, "y-m-d"); if (!$IsPrototype) { $Rule = ""; } 



This will run the rules you want. Place the `if` sequence at the very end. It checks the note to see if it is not a prototype, and if that is true, the entire rule will be wiped out.

Another thing you can do is put everything inside the if test if you don't want them to run on the prototype. This might be a good idea, unless you don't mind the name of the prototype changing. A simple example here would be:

Code:
if(!$IsPrototype) { $Name = "Journal: " + format($Created, "y-m-d"); $Rule = ""; } 



If you grasp the differences between is going on between these two, you'll probably think of a variety of interesting things you can do where prototypes use a subset of rules for their own purposes, while instances use the full set of rules (potentially up to the point of wiping them out, or switching them to another, slimmer, prototype---a method I often prefer for more complicated situations).
Back to top
 
« Last Edit: Dec 28th, 2009, 6:10pm by Ioa Petra-ka »  

Av
  IP Logged
AGHorne
Full Member
*
Offline



Posts: 116

Re: Creating a journal with name=date created
Reply #8 - Mar 13th, 2010, 9:52pm
 
I'm having some issues doing this, but I'm using $Date attribute for my display expression.

I would like to use a Date attribute, rather than $Created.  

I enter $Name=format($Date,"m-d-y"), but it will never update the title after I enter the date.  The title remains "never".  

Is an autocomplete only possible with $Created in the display expression?

The reason I ask is because I've been using MacJournal for my journaling and I would like to move to TB.  I want to import my MacJournal entries into my TB document, but I'm obviously having issues creating an entry today that was written in the past and wanting that specific date as the title...

I could rename the note, but then I screw up my sorting, which is by $Created.  I guess I could sort it by $Date, but if I can only get the Display Expression to work with $Created, then I'd like to just use that attribute...

Any suggestions?
Back to top
 
« Last Edit: Mar 13th, 2010, 10:20pm by AGHorne »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Creating a journal with name=date created
Reply #9 - Mar 13th, 2010, 10:53pm
 
I can't replicate your problem.  If I set a $DisplayExpression:

$Name = format($Date,"m-d-y")

The name of the note remains unchanged as the above isn't code TB understands in this context. I think you meant to use:

format($Date,"m-d-y")

This does work and the note name becomes 'never' until I set $Date when it becomes '3-14-2010'.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
AGHorne
Full Member
*
Offline



Posts: 116

Re: Creating a journal with name=date created
Reply #10 - Mar 14th, 2010, 1:02am
 
I have $Name=... in OnAdd and not the actual display expression box.

My scenario is:

I have a container named "Journal" and a prototype named "ProtoJournal". Inside my "Journal" container I have my actual entries where I want the date as the title.

For my Journal container I have the OnAdd commands as:
Prototype=ProtoJournal; $Name=format($Date,"m-d-y");

Is there a simpler and/or smarter way to achieve this?  Like I said, it works with $Created attribute, but the fact I can't edit that is a kicker...
Back to top
 
« Last Edit: Mar 14th, 2010, 1:18am by AGHorne »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Creating a journal with name=date created
Reply #11 - Mar 14th, 2010, 7:54am
 
TB is functioning correctly. Currently, your container action is this:

$Prototype="ProtoJournal"; $Name=format($Date,"m-d-y");

and it's setting the new note's $Name to the explicit value of $Date at the moment the note is created. We know this is 'never'. However, you've forgotten to add any code that subsequently tells the new child note to update the $Name to reflect the present value of $Date.

A fix might be to use this container rule:

$Prototype="ProtoJournal"; $Name=format($Date,"m-d-y"); $Rule='$Name=format($Date,"m-d-y");';

(Note how the whole $Rule argument is one string for which we use enclosing single quotes as the rule's code contains double-quotes).

However, rather than set a Rule for every note it might be better to push this out to an agent.  Let's assume your container is called 'Journal" for the sake for the follwing example:

Query:  inside(Journal)
Action:  $Name=format($Date,"m-d-y");

For efficiency, the query first restrains it's focus only to those notes that are direct children of the 'Journal' container; if there was some nesting of new journal notes, this could be changed to descendedFrom(Journal).

The agent's rule then corrects the note's $Name to reflect the data value.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
AGHorne
Full Member
*
Offline



Posts: 116

Re: Creating a journal with name=date created
Reply #12 - Mar 14th, 2010, 10:19am
 
An agent creates an alais, so would the name change only reflect the copy of a note?

So in the agent I would have 03-14 (HAPPY PI DAY EVERYONE!) for a note that still is called "never" in Journal...

I'm just curious, but regardless, I suppose the easiest step would be use $Created for my current TB Journal and have another container with my archived entries and use a manually titled $Date for the title.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Creating a journal with name=date created
Reply #13 - Mar 14th, 2010, 10:47am
 
I'm now totally confused as to whether you do or don't want a name that is just a date or a date plus text in a particular order.  Could you make a small example TBX we can use as a common frame of reference?
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Creating a journal with name=date created
Reply #14 - Mar 14th, 2010, 11:13am
 
Re $Name and alias vs note. Only a small number of attributes (such as $Xpos, $Ypos) are intrinsic - i.e. different for alias and original. You are right the an agent action is acting on alias  but in the case of $Name changing the alias also changes the original.
Back to top
 
« Last Edit: Mar 15th, 2010, 12:57pm by Mark Bernstein »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1 2 
Send Topic Print