Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Agent, Actions, Rules & Automation >> Setting a date attribute from a date in note text
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1195170885

Message started by Fionnbar Lenihan on Nov 15th, 2007, 6:54pm

Title: Setting a date attribute from a date in note text
Post by Fionnbar Lenihan on Nov 15th, 2007, 6:54pm

Hi
I am experimenting with using Tinderbox for creating a log or a work time diary  to account for every minute of my day for a few weeks (it's part of our appraisal process God Bless the NHS).

Using the email to Tinderbox function I can email in my notes from work or from my PDA on the move.

Basically, when I finish something I send the document email address an email with the thing I've been doing in the email header.

eg
Did pointless paperwork

The text of the email is like this

date:15-11-2007
start:15.10
end:15.45

I've created attributes called diaryday, starttime, endtime and a prototype, protodiaryitem which has these as key attributes.

I've set an OnAdd action for the mail container to make incoming notes use the protodiaryitem prototype.

prototype=protodiaryitem

I would like to be able to have a note set it's own diaryday, starttime and endtime from the text in the note.  I initially thought it would be simple (like on page 75 of the Tinderbox Way) but I hadn't thought it through - each note will have a different time and/or date.  

I guess it would need the date and time text to be stored in a variable of some sort and then the attribute is set to the variable rather than a constant if that makes sense.  

Not sure how to do that though

Help gratefully received

Fionnbar


Title: Re: Setting a date attribute from a date in note t
Post by Mark Bernstein on Nov 15th, 2007, 7:28pm

Suggested outline: use regex to isolate the dates and times in $1, $2, etc.

Then assign date attribute from the regex.

Busy prepping for Tinderbox weekend here -- happy to flesh this out after the event, but you vcan likely solve it from this.

Title: Re: Setting a date attribute from a date in note t
Post by Mark Bernstein on Nov 16th, 2007, 12:36pm

There's an experimental feature in the latest Tinderbox beta, incidentally, that lets you email notes to Tinderbox with instructions for setting attributes.  This means you could say:

Quote:
Tinderbox: /UrgentIdeas [Color=red;Status=Important;]

in your email, and Tinderbox would act accordingly.

I'm breaking the rule here about discussing beta features.  This is a one-time event; the rule is still the rule. -- MarkBernstein

Title: Re: Setting a date attribute from a date in note t
Post by Fionnbar Lenihan on Nov 16th, 2007, 7:28pm

All legal systems require exceptions

:)

Thanks for that.  The latter feature might be easier than mastering regexps at my age

Fionnbar

Title: Re: Setting a date attribute from a date in note t
Post by richratzan on Jun 17th, 2008, 4:16pm

i apologize in advance if this has already been covered and/or worse am in wrong thread

what i have just started doing for dates is using an attribute for date and setting it to a string and then writing date out yyyymmddtime where time is a four digit military time

for example, if a character dies at any age, at 4:30pm on june 22, 1948, i set key atttribute to datehap (or some such shorthand for it being a date) and enter 194806221630 and then switch to outline and sort by datehap (which is really sorting strings)

i initially tried above with setting attribute to number, not string, but once you get past 8 digits, e.g. 201206171604 (the date and time of this note), tinderbox converts it into the number 2147483647, a number i do not understand (does not look like hex). this is not a problem with string

works better for me than the date attribute, which i have found quirky depending whether you write june 22, 1948 4:30pm, or 6/22/48 4:30pm


rich ratzan, an admittedly wet behind the ears tbx newbie and scripting/programming ignoramus
using tbx 4.2.3 on a macbook 2.16 intelcore 2 duo, 2 GB ram, os 10.5.3

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.