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 >> OnAdd question
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1451942859

Message started by Michael Webster on Jan 4th, 2016, 4:27pm

Title: OnAdd question
Post by Michael Webster on Jan 4th, 2016, 4:27pm

Sorry in advance that I'm probably missing something jaw droppingly obvious...

I'm reading The Tinderbox Way and in the list section find the following recommendation for setting actions that occur when a note is dropped into a container:

OnAdd: $Completed=true; $Status="complete";$CompletionTime=
date(”today”);$Color=;

When I do that OnAdd, I made it so it turns the color of the box red, and that works; but I cannot find "Completed", "Status" or "CompletionTime" anywhere. How am I supposed to add them to the note, or prototype? Are they user defined attributes?

Title: Re: OnAdd question
Post by Mark Bernstein on Jan 4th, 2016, 5:30pm

This is simply an example.  In this case, Tinderbox Way assumes you have already created three user attributes (in the Document inspector’s User pane)

    $Completed: a boolean attribute
    $Status: a string attribute
    $CompletionDate: a date attribute

Getting Started With Tinderbox has more detailed walkthroughs of the mechanics of creating and using attributes; here, The Tinderbox Way is focussing on the sorts of things one might do with attributes.

Title: Re: OnAdd question
Post by Mark Anderson on Jan 4th, 2016, 5:42pm

My copy of the book's the first edition but i'm guessing you're referring to page #39 in Chapter #3 ("List and Cntainers"). My version has different, but similar code there. Those latter three attributes are indeed user-added attributes as they aren't system attributes; it's worth noting that the book isn't written as a step-by-step tutorial.

From the values being assigned, I'm assuming $Completed will be Boolean data type, $Status is a String type $CompletedTime will be Date-type.

Althuogh you can add those attribute named to your OnAdd code, they will have no effect unless the names attribute(s) actually exist.

Add user attributes via the User sub-tab of the Document Inpsecctor.

Title: Re: OnAdd question
Post by Michael Webster on Jan 4th, 2016, 8:44pm

Thanks. Sorry, I should have read further before posting. Just a little excited to get going.

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.