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
Send Topic Print
Unique Identifier in Note Title (Read 793 times)
wajakob
Full Member
*
Offline



Posts: 10

Unique Identifier in Note Title
Jun 27th, 2016, 3:09pm
 
I am working on using a Tinderbox file as a Zettelkasten.  For this I need to have a unique identifier for each note.  Is there anyway to auto insert date and time in the note title?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Unique Identifier in Note Title
Reply #1 - Jun 27th, 2016, 3:30pm
 
Yes, you can use a rule (or edict if you want itto run less often) in the note, an on add action in the parent container or use an agents's action.

This action code appends the date to the front of a note $Name:

$Name = date("now").format("y-M0-D h:mm") + " " + $Name

If your note is called "Brexit nightmare" and the date time is currently 27/6/16 20:22, then the above action would reset the note name to "2016-06-27 20:22 Brexit nightmare".

You'll also want to consider how you want to stop the code running more than once, but the above gives you the basic parts of the solution.
Back to top
 
 

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

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Unique Identifier in Note Title
Reply #2 - Jun 27th, 2016, 4:22pm
 
Alternatively, you might create a sequential numerical attribute -- perhaps named IndexNumber, which will be distinct for each note.  You could then use a DisplayExpression

     $Name+": "+$IndexNumber

And have notes appear like

    Theodore Roosevelt:132
    Living room renovation idea: 133
    Pick up bagels: 134
    Eugene Debs: 135
Back to top
 
 
WWW   IP Logged
wajakob
Full Member
*
Offline



Posts: 10

Re: Unique Identifier in Note Title
Reply #3 - Jun 27th, 2016, 5:57pm
 
Many thanks.
Back to top
 
 
  IP Logged
Derek Van Ittersum
Full Member
*
Offline



Posts: 168

Re: Unique Identifier in Note Title
Reply #4 - Jun 28th, 2016, 7:01am
 
I had the same thought as you--creating the unique identifier based on the name. But then I remembered that each note already has its creation date associated as an attribute. Within Tinderbox, it's not that necessary to add it to the name, in my mind. So, I created a display expression to show the date along with the name. Then I decided that was too cluttered and left the unique identifier as a hover expression instead.

Then, if I ever decide to export the notes from Tinderbox, I can still use that unique identifier (essentially just the date/time as a numerical string). Via export code, I could export each note with a file name consisting of the unique identifier and the note name.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print