OnAdd action didn't work, wondering why


(David Berreby) #1

Can anyone explain to me why this didn’t work? I was trying to specify that the prototype “organization” should apply to any note inside the note “Organizations”. Following the instructions in ‘Getting Started with Tinderbox’ I did this (see below). But new notes created in the space are not taking the prototype. Either the instructions are wrong or they are not right for my situation. If the latter, where can I go to get info that better fits what I want to do?
Thanks for any insights!


How to set a default prototype for new notes in a container?
(eastgate) #2
  1. The OnAdd action for the note /Organizations looks fine. It will set the prototype of new notes inside that container to Organization.

  2. Is there a note named “Organization”? (Are there several notes named Organization? That, too, is a common mistake.)

  3. If you intended that the prototype be Organizations and this is a typo, that is probably not what you want. Notes that adopt a prototype normally receive copies of the prototype’s children; in your case, new notes would receive copies of all the children inside /Organizations, which would be bad.

  4. My favorite trick for checking whether an action is actually acting is to add some obvious visual change to the action. For example

$Prototype=“Organization”;$Color=“blue”

or

$Prototype=“Organization”;$Badge=“check mark”


(Paul Walters) #3

To augment Mark’s suggestions. In the Action inspector when your type Attribute names, and when you type values for attributes such as $Prototype, Tinderbox offers completion suggestions. This helps ensure you are getting attribute names and values right. Once you type the string $Prototype= you should see a list of the note names (already surrounded in quote marks) that are actually prototypes.

If the name you’re expecting to see is not in the list, then it isn’t a prototype.


(David Berreby) #4

Hi, Mark,
What you describe in (1) is what I expected. It did not happen.

There is only one note named Organization. It is a prototype which I expected to associate with any note created or added to Organizations, with an s.

I did not intend the one with the -s to be the prototype.

OK, things just got weirder. I tried your suggestion of adding a color to the OnAdd. Then I created a new note. This note DID take the prototype. However, it did NOT change color to blue! Perhaps there is some syntax thing I am not doing at the end of my lines?

I was going to send a screenshot but Tinderbox just quit on me. Here, I have it back now.


(David Berreby) #5

And the app just quit again. I can send the report if you like. Meantime I will restart my Macbook and hope some weirdness will be exorcised.


(Paul Walters) #6

David, what release of Tinderbox are you using (and what macOS version)?


(David Berreby) #7

Hi, Paul
Sorry, should have mentioned: Tinderbox 7.0.1, OS 10.12.3, Macbook Pro, mid-2014


(eastgate) #8

It looks to me like you’re separating statements with a colon. You ought to separate statements with a semi-colon.


(eastgate) #9

This is the sort of thing where posting your Tinderbox document, or sending it to support (info@eastgate.com) is often more efficient.


(David Berreby) #10

Will do. Btw, it is indeed a semicolon. Fuzzy screen shot.
Thanks!


(eastgate) #11

The problem was

$color=“blue”

Attribute names are case-sensitive, and the built-in attribute is $Color.


(David Berreby) #12

Got it! Thanks! I thought I was using the built in prompt but I must have typed it myself.