Tinderbox Forum

Adding KeyAttributes

I can’t find the correct code for $OnAdd to add additional $KeyAttributes for all notes within a container:


overwrites all existing KeyAttributes. How can I add KeyAttributes?

*(Learning, Known and NotKnow are already defined user-attributes.)

What about this:


And if that fails, I’m not sure if TB allows for Smart Quotes there. I also assume you meant ‘NotKnown’ not ‘NotKnow’. Perhaps that’s why it failed.

Yes, this works. I missed the parentheses. Thanks, Ralph!


Assuming the curly quotes are due to forum re-formatting of text, when I test:


I get 3 new attributes in the notes KAs. So I wonder if there is some other factor at play in @Dirk’s document.

In action code, adding a string of semi-colon delimited terms to a Set or List type attribute will cause the string to be parsed into items and each of those will be added as a new list item. See more.


This does work, too. Of course, the quotation marks must be straight quotes.

Could it be because his original code misspelled ‘NotKnown’ and there was no User Attribute $NotKnow?

I doubt it. I added a $Learning attribute and note the other two, then used the code to stamp a note with an existing KA. The result:


The greyed out items in the KAs are attribute names defined in the notes $KeyAttributes list values but which don’t match an existing attribute.

I tried $KeyAttributes=$KeyAttributes+"Learning;Known;NotKnown" again and it works now. Probably I really used incidentally curly braces (wasn’t aware of this).

So thanks again, everybody.
Really appreciate your efforts!