Here is a really good one for you to keep in mind = vs. ==.
When you’re running action code there you can use “=” and “==” arguments.
You use “=” when you want to assign the value of the argument on the right side of the equation to the attribute on the left side of the equation. For example, $Text=“Hello World.” would make the value of the note’s text “Hello World.” Or $Name=$Name+" “($Created.format(“l”))”, would change the name of the note to EXISTING NAME (DATE). IOW, if the note’s name was “This Note” and you created it on 3/14/21, after applying this action code (via a Stamp, Rule, Edict, OnAdd or Link Action) the note’s name would be transformed to “This Note (3/14/21)”.
As for the double equal “==” this is a logical test, e.g. does the left side of the equation equal the value of the right side. For example, let’s say you want to run a query but you only want to return aliases. You could say $IsAlias==true. Or, if you wanted to only get the notes that were assigned with a specific prototype you could say $Prototype==“Person”, which in an agent would only return those notes with the prototype person. If you wanted to combine the two arguments you could, e.g. $Prototype==“Person”$IsAlias==true. This would return all the notes that are assigned to the person prototype and that are aliases. If you did not want the aliases, instead of == you’d use !=, which means is not, e.g. $IsAlias!=true. Note, you don’t need to quote true or false, but all other equality arguments you do need to quote. For instance, $HeadingDepth==“1” would be the correct way to test if the value of the $HeadingDepth attribute for a given note was equal to 1.