Rules not running

Hello,
I created a rule on prototype note called pPapers:
if($checked=="true"){$Badge="ok";} else{$Badge="calendar";}. I have checked ‘enable’ on the rule pallet.
I added an attribute, ‘checked’ to the protype

I created notes and assigned the protype pPapers to them. However, whenever I check the checkbox, nothing changes.

Would appreciate how to solve this problem.

Using the latest Tinderbox on the latest MacOS

Thank you!

Remove the quotation marks around true. Also set Tinderbox to only use straight quotes.

And, I think you could actually omit the explicit test (==true), i.e.

if($checked){
$Badge="ok";
}
else{
$Badge="calendar";
}

Pretty sure that’s the fix. Someone will be along shortly if I’m wrong…

Thank you!

I made the changes you suggested; however, still not changing the badge according to the checked status.

btw
When a note has not taken the attributes and rule of its prototype automatically, how to force it to take up the change made to the prototype?

Thank you!

if($checked==“true”){$Badge=“ok”;} else{$Badge=“calendar”;}.

The system attribute is named $Checked. (Almost every system attribute begins with a capital letter; the exceptions are all obsolete attributes you are very unlikely to use.). SO:

if($Checked==true){$Badge=“ok”;} else{$Badge=“calendar”;}.

If unsure about the spelling, data type, etc., of system atributes, a list can be found here: System Attribute List.

Note that all attribute names (system and user) and action code operator names are case-sensitive (which is why $checked and $Checked are not the same in action code).

Also, in action code single or double quotes used to enclose text values must be of the straight form and not typographic (so-called ‘curly’). This is because the two types of quote characters may look similar to the eye but not to software code.

Thank you eastgate and mwra!
as you suggested, when I changed the case (to the capital), the problem was solved!