Set a Global Property from a Clip Property
The following code takes the contents of a Test Clip custom property, such as scriptSessionID (see Extract a SessionID), and places it into a global property.
For this script to work, you must first:
- Create a Global Property List called ScriptGuide (using Central > Global Property Lists)
- Create a Global property in that list called GlobalSessionID
- Create the Custom Property scriptSessionId within the given clip (clip properties are defined in the lower sub-panel of the Test Clip Editor).
How to
The first line sets a variable, clipPropValue, to the value of the custom property scriptSessionID, from within the current clip.
What you should see
var clipPropValue = $prop.value("MessageClip", "scriptSessionId");
The second line sets the global property, GlobalSessionId, in the global property list named ScriptGuide, to the value retrieved in the first line.
$globalprop.set("ScriptGuide","GlobalSessionId",clipPropValue);