With this code, I was expecting that when Check_A and Check_B are checked, the Check_B would be unchecked and "Check_C’ would appear for $Xlastcheck. However, when I test, the results were unpredictable
Scenario 1
Interestingly, when I check both ‘Check_A’ and ‘Check_B’, there is no change in the value of $Xlastcheck.
However, when I uncheck B, the value of $Xlastcheck changes to ‘Check C’.
There is unpredictable behaviour of checking Check_A and Check_B
Scenario 2
If I check Check_A followed by Check_B and then uncheck Check_A, Check_B becomes unchecked as well.
I wrote a long code in the rule pane (wrote it in BBedit and pasted it into the Rule pane). Howvever, I could not to the bottom half of my code. I did not see a vertical scroll to the rule pane. Is there a limited to the length of code in the Rule pane.
Scenario 1
Rules are reluctant to run on notes that are selected, since the Rule might undo something you’re working on. If you deselect and reselect the note, I believe the results will be as you expect.
Scenario 2
If you check both checkboxes and the rule runs, the rule will uncheck Check_B but might not immediately update the Displayed Attributes Table. This leads to the potential result you observed.
Long Code
The code editor in the Rule Inspector does not scroll, though the window can expand to accommodate longer passages. Short rules are best! When a rule starts to get long, consider using functions to make it easier to follow.
If working on a rule or edict in the Inspector, consider unticking the ‘enabled’ box. This stops the app trying to run this notes rile (or edict) while you work on the code and until you tick the box again.
I’m not sure there’s a video tutorial. There’s a good meetup from a while back on using functions, and of course there’s the page in Tinderbox Help for starters, and in aTbRef for more depth.