Re: [Tb] Very new user

From: Mark Anderson <mac__AT__yeardley.demon.co.uk>
Date: Mon Feb 20 2006 - 08:00:55 EST

On 18/2/06 12:13, "Sue Malvern" <s.b.malvern__AT__reading.ac.uk> wrote:

> I am very new to using TB.
>
> Can anyone explain OnAdd?
>
> I want to drag notes from one TB file to a container in a new TB
> file. The dragged notes will be children of the container. Can I set
> an OnAdd action that makes the new dragged notes take on a specific
> prototype (ie color attribute and so on)? Is this impossible to do?

No, not impossible. You can indeed make the receiving container set a
prototype for notes newly added to it. You are correct in assuming the OnAdd
Action is the place you need to put some code.

> In the 'rename note' window, there is a sub-window for an OnAdd
> Action, but I haven't understood what I need to do to activate this,
> and what the syntax ought to be ie Prototype = "the name of the
> prototype I have already created"?

To 'activate' the action, you just type code into the action box, it really
is as simple as that. In early TB versions the box was called 'Action' and
was re-titled OnAdd Action to clarify:
 - Actions are carried outon any note created within or dragged into a note.
 - The code you set is stored in the OnAdd attribute - by making the latter
a key attribute for a note the OnAdd value is shown in that notes text
window. You may find this an easier way to see/edit such code.

Note that actions are carried out once only - as the 'on add' point. To
apply changes after a note is added you should use an Agent. An OnAdd action
applies to the direct contents of the containing note. Thus if a note with
children of its own is dragged into a new container, only the top level note
but not it's descendants is acted on. Just try dragging a note and a note
with children into a container - the difference is easier to see than
describe!

Martin Spernau's already given you some concrete examples of code. A few
additional points...

In case it wasn't spelt out, yes, you can drag a note from one TBX file to
an different TBX file and have an OnAdd action happen - i.e. this doesn't
only affect notes created/moved inside a single TBX file.

As regards syntax, you may find this Tinderbox wiki article of use:
http://www.eastgate.com/wiki2/wiki.cgi?UsingLetterCaseCorrectly

---
Regards

Mark Anderson
Tinderbox wiki gardener

Tinderbox Wiki: http://www.eastgate.com/wiki2/wiki.cgi?TinderboxWiki
aTbRef: http://www.acrobatfaq.com/tbx/index.html
Received on Mon Feb 20 08:00:59 2006

This archive was generated by hypermail 2.1.8 : Mon Jun 19 2006 - 13:29:04 EDT