The designator this describes the current note (i.e. the note currently in focus). The focus of this can vary slightly by context:
- in $Rule: the note whose rule is running
- in $OnAdd: the note that is being added
- in $AgentQuery: the note that is being examined
- in $AgentAction: the alias that is being examined
- in find(), collect(), etc: the note that is being examined
Beware of nesting changing the context. Consider the following rule:
$Text=find($MyString==$Name(this))
Although the overall context is a rule, the rule contains a find, which in turn holds the 'this' designator. Therefore in the above example 'this' is evaluated in the context of the nested find() and not as in a simple $Rule.