With lists—i.e. List and Set data types ($Tags is a Set) you need to add a value:
$Tags = $Tags + "some value";
Or in v9.1.0+, a shorter form:
$Tags += "some value";
But Quickstamp can only set the value of an attribute, i.e. the entire value. So it can’t be used with List/Sets/Dictionaries unless is is to set an initial value or to completely wipe/rest the existing value(s).
Side-note to self, I see description of Quickstamp really needs a health warning about use with multi-value data types as it has no syntax to add to, or remove from, existing list value(s). @eastgate, before I edit my docs—is this true, or am I missing some syntax?
In fairness, Quickstamp goes back to the dawn of Tinderbox, when things were much simpler. No List type then, just Sets which has a ~
toggle mode now no longer seen.
So, we need a stamp. But, how to avoid hard-coding the desired new values into the stamp? Use a note to hold the values and an offset reference. So, we add a note, for example ‘Tag stub’† and add MyString
as a Displayed Attributes‡. Now add a Stamp:
$Tags += $MyString("Tag stub");
Now, to do your task, select note “Tag stub” and enter the new value. If more than one tags, simply place a semi-colon between discrete values. Now select the desired target notes and use the stamp.
You could also have a delete tag stamp counterpart:
$Tags -= $MyString("Tag stub");
Note, I’m deliberately not using $Tags in the “Tag stub”. Why? Firstly you don’t need to: you just need a string attribute value (that can also (semicolons!) be a list. Secondly, $Tags is something where you might want to collect all the used tag values (values()). In the latter case it would pick up any values you may have left set in the “Tag stub” note, potentially giving you a false positive in the list.
†. You can use a different name but adjust the stamp’s code. Do make sure the name is now that won’t be a duplicate.
‡. You could use a user attribute if you want—String or List type, it doesn’t’ matter. Don’t forget to alter the stamp’s code if you do.