![]() |
The routines you create in a script can use other components in the project. For example, a routine can play a segment file.
Any component you use in a script must be placed into the Script Content folder of the script in the project tree, in either the Embed Runtime folder or the Reference Runtime folder. The Script Content folder is essentially a container. For more information, see Containers.
You can insert a component into the Embed Runtime or Reference Runtime folder of a script by dragging an open component from elsewhere in the project tree onto the folder icon.
The following figure shows a script file named Script2, with its Script Content folder opened to show the Embed Runtime and Reference Runtime folders, each containing a segment.
Note that both segment icons are shortcuts. When a component is inserted in a script content folder, regardless of whether it is the Embed Runtime or Reference Runtime folder, the original component remains at its current position in the project tree and is not saved as part of the script design file. However, the contents of a component in the Embed Runtime folder are inserted into the script run-time file, ensuring that the component is available for use in the script without the need to distribute extra files.
You can rename the shortcut by clicking Change Content Identifier on the shortcut menu. In the script, refer to the content by the name of the shortcut, not the name of the original file.
Components in the Reference Runtime folder are not saved in the run-time script file. The component must be provided as a separate run-time file. The Reference Runtime folder is useful when a component is used by multiple scripts, because it reduces unnecessary duplication of the component in more than one file.
A component cannot be placed in both the Embed Runtime and the Reference Runtime folder. If it is embedded, there is no need to reference it.
Any component embedded or referenced in a script is available to an application that loads the script, and can be retrieved by name just as if a global variable of that name had been declared in the script.