[Edit: this works but the solution by @eastgate, 2 posts down, is much simpler]
How about:
$Color="red";
var vOthers();
vOthers = collect(descendants, $Path);
vOthers.each(aNote){
$Color(aNote)="red";
};
The initial line acts on the selected note, the next line finds all its descendants and applies the same code. I’m using a variable so there is no List-type attribute to clean out after the process as the ‘vOthers’ is deleted as soon as the stamp completes.
Obviously the actual task isn’t as trivial as setting a colour, but that there just to indicate how both thee container and all descentants are acted upon.
Thanks Mark. I am moving into new territory for my Tinderbox skills with using the variable and the .each() operator. Your example allows me to understand its use case. My assumption is that there is no specific designator to use in this case is correct. The designators this() and descendants() apply only to a part of the problem which is why you suggest using a variable and .each.
Another approach I was thinking about using was to try a prototype and a rule as well. The limitation here would be that the rule would not be a once only action like a stamp. I will play with both. Thank you again.
That’s a rather cyptic question. If unsure of the syntax for .each loops see here.
FWIW, I’ve adopted a personal method—i.e. unofficial—of naming variables thus:
var() variables, I use a lowercase v prefix before a capital letter of the variable name. Thus vString or vItems.
in-loop variables as in .each() and some other operators, I use an a or an prefix before a capital letter of the variable name. Thus aNote or anItem. This reminds me the reference is to the loop’s current list item.
Having different prefixes helps both show these are user-defined variables and which are scoped to the action and which to within the loop.
When writing Tinderbox action code you can set temporary user variables or leverage regex back references that will hold a data values that the action script will use later in the processing of the rule, edict or stamp. I’ll do a quick video on this weekend.