Using a message with local scope

Once a message has 'local' scope, it can be accessed by any other clip element in the same test clip. Its values can be used in scripts and to set clip properties. A typical method is to place a script after the scoped message. Such a script will typically refer to the position of the scoped message, do something with the message response, and then clear the response from memory.

For example, in a script placed immediately after the scoped message, you would get the preceding message using this code:

The script doesn't have to be the next item in a test clip. For example, if the message is two prior, use

context.currentItem.previousItem.previousItem;

var msg = $context.currentItem.previousItem;

There are a variety of uses for a given message response (including, but not limited to, the following example scripts: