To help, here are the commands and constructs that will change the value of it. The following commands always set the value of it, as their normal way of returning a value:
The following commands sometimes set the value of it, depending on how they are used. Generally, if the value passed to one of these commands is a container (such as a variable), the contents of that container are altered directly. If the value passed in is not a container (such as a literal value or an expression), the result is returned in it:
In addition, the repeat with each command uses it in its simplest form when a specific loop variable is not supplied:
repeat with each... (when no variable is provided)
When any of the commands listed here implicitly set the value of it, they set it to be an ordinary variable, not a reference. If it was previously a reference, it is unlinked from the container it referred to before being set.