Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
Tinderbox Users >> Agent, Actions, Rules & Automation >> Inheriting prototypes

Message started by Ellen Madono on Nov 10th, 2016, 2:57am

Title: Inheriting prototypes
Post by Ellen Madono on Nov 10th, 2016, 2:57am

I am starting back with Tinderbox.I never got very good at using it.

This time I'm going to try to be simpler.  :D

I only want to set up prototypes that can be used in other tinderbox   Files/documents. The prototype simply indicates a color for the note.   I want to copy a  container of notes and   paste it in a new tinderbox document.

I was able to set up a note with the prototype  indicating that I wanted a red note.   I was able to make new red notes with this prototype within that file/document.    However, when I copied to a new document, the prototype was lost.  

I tried using the template, but that didn't  help.

I am leery of experimenting because already I have a prototype that I don't want and I don't know how to erase it. The notes that I made in the past year or so ago  have a  mistake, so instead of trying to undo the mistake I am starting  again  :-*

Thanks,  you were very helpful in the past but I think my project was too complicated.


Title: Re: Inheriting prototypes
Post by Mark Anderson on Nov 10th, 2016, 4:22am

Copy/pasting prototyped notes between docs needs care as it has to allow for the fact that two different docs may have a same named prototype but with different configuration. In Tinderbox (certainly in v5 and v6) if a same-named prototype exists in the target document, pasted items with prototype assignments will automatically re-connect with the right correct prototype. If a copied selection includes that prototype used by some/all of the copied selection, the pasted items retain their prototype assignments (you may then want to move the pasted prototype to a more suitable location).

From the above, it probably makes best sense to first find and copy any prototype that need to move across and paste those into the target document first. This allows you the opportunity to detect issues where two documents have a prototype with the same name but different customisation. That done, copy across the notes and they should automatically re-connect to their prototypes. If this doesn't happen please give a more detail description of what you're doing so we can follow the steps. Templates have nothing to do with prototype settings in notes but are used to define export of data; think of them as 'export templates' if that makes it clearer. Here you aren't exporting your notes, but copying them to another document

Thus in your scenario, copy/paste the red note prototype to the new document where you wish to put prototypes. Then return to the source doc, select the desired notes using the red prototype and paste them into the target document where you wish to use them; they should resume their use of the (pre-added) red prototype. Pasted-in notes with a $Prototype value (i.e. an prototype has been set) that can't find their assigned prototype on pasting have their $Prototype reset to default (i.e. no prototype assignment value).

To delete a prototype, find that note and delete it. All notes using that prototype will cease to inherit any values from it and will have their $Prototype reset to default. It's that easy.

It's worth noting that if you rename a prototype, any notes using  that prototype will automatically update their $Prototype value to reflect this, i.e. renaming a prototype doesn't break existing assignments (but things like $OnAdd code setting a prototype will need manual updating).

Title: Re: Inheriting prototypes
Post by Mark Bernstein on Nov 10th, 2016, 9:04am

Taking a broader view, have you looked through the GETTING STARTED WITH TINDERBOX tutorial in the Help menu?

It should be helpful with mechanics like these.

As for prototypes: if you decide you no longer require a prototype, just delete it as you'd delete any other note. Select the prototype, then press delete.

Title: Re: Inheriting prototypes
Post by Ellen Madono on Nov 12th, 2016, 8:38am

I read what I could find on prototypes in the help section in tbx, I see I should have made a note that is the prototype source.  I read that somewhere a long time ago.  Anyway, if I don't know that first note that created the prototype, it seems that I can't get rid of it.  True? :(

Title: Re: Inheriting prototypes
Post by Mark Anderson on Nov 12th, 2016, 10:03am

I see I should have made a note that is the prototype source

I'm not sure I understand. Are you trying to find out what prototype a note is using, or where that prototype note is (so you can delete it) - or both?

Using Map view, see how to check if a note has a prototype. Here's the image from that article:

In the picture, we know the document has 3 prototypes available (as in the popped-up list) and that the currently selected note uses a prototype called 'Person'. To change the prototype, click on a different item in that list or click the 'none' item to remove use of a prototype. The latter doesn't affect the prototype note, it just means this note will stop using the prototype.

How to find a prototype note (e.g. because you want to delete it)? First, in your own TBX, trigger the pop-up list like above and make a note of the name(s) of the prototype(s) you wish to delete. In recording the prototype names remember they are case-sensitive meaning that 'person' and 'Person' are not treated as being that same thing in a search.

Finding your prototypes. Very often you'll find your prototypes all inside a container called 'Prototypes' at the root (what's 'root'?) of your TBX document. But, let's assume you can't remember where you created the prototype - as a prototype note can safely exist anywhere in your document. Lets's also assume we want to find a prototype called "Person" (I'm choosing a specific name just so you can see how to customise the code examples). Thus:
  • Switch to Outline view.
  • In the main 'Note' menu, click 'Create Agent'.
  • An agent is created and you'll see a pop-up.
  • in the 'query' box type: $IsPrototype & $Name=="Person"
  • Press Return and the pop-up closes.
  • Your agent should now list 1 item, called 'Person'. The icon to the left of the name should also show a green circular background indicating this is a prototype.
  • You are looking at an alias of the note you need so right-click the alias.
  • In the pop-up menu, click 'Show Original'.
  • The view's location/selection will now change to show the the actual original 'Person' note.
  • Select this note and delete it.
  • Any notes that were using that prototype will have their prototype assignment reset to default and will cease to use attributes inherited from the prototype. So whether 1 note or 100 notes use the same prototype, deleting the prototype note will mean those notes now use no prototype.
Now, having sorted this out, you may find some of the note(s) have settings, e.g. colours, you don't expect. Such behaviour will indicate that the attributes controlling the colour, etc., of those notes has been set in the note itself and wasn't being inherited. In which case you'll need to go to such notes and reset the relevant attributes.

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.