How do I cause the Messages, Browser Actions, or Scripts in a Test Clip to use different values when the Test Clip is used in different Test Compositions, or in different places in the same Test Composition?
There are two ways in which a Test Clip that is used in more than one Test Composition, or in more than one location within the same Test Composition, can adjust its behavior according to the location in which it is playing:
|Method 1 - Use of Custom Properties (preferred)
Your Test Clip, as well as the items in your Test Clip, can contain Custom Properties. These Custom Properties can be used to insert values into Messages and Browser Actions before they are played. In addition, any Scripts in your Test Clip can check the values of those properties and change their behavior accordingly.
When a Test Clip is added to a Track in a Test Composition, you can specify what initial values are to be set for the Test Clip-level Custom Properties and for the System Properties of the Targets within the Test Clip. (This is somewhat akin to passing parameters to a subroutine.)
|After the Test Clip has been placed onto a Track in
the Composition Editor, follow these steps:
Note that you cannot directly set the Custom Properties of other items inside the Test Clip (such as Messages or Browser Actions). However, a Script inside the Test Clip could copy the values from the Test Clip Custom Properties to other Custom Properties, if the other items were not using Test Clip Custom Properties.
|Method 2 - Checking the location via Scripting (not recommended)
A Script can programmatically traverse the object hierarchy of the Test Composition in which it resides, and can determine things such as the names of the containing Track, Band, or Test Composition, or the instance name assigned to the containing Test Clip. See the Scripting documentation for more details.
The Script could then adjust its behavior based upon its determination of where it is being used. This would allow the Script to modify Messages or Browser Actions, or change the values of Custom Properties used by Messages or Browser actions, or change the values of System Properties.
This methodology is not recommended, however, because if someone unaware of this changes the name of the Test Composition, Track, or Test Clip instance, or makes a copy of the Test Composition under a different name, the logic could be inadvertently broken.