Script Resources

You may have noticed in the section on Script dialogs that scripts can have “resources” associated with them. This is XML-formatted data that provides resources to the script but doesn’t actually form part of the script code.

 

There are two types of script resource currently in use, dialogs and strings. When you use the command editor to design your script, the resources are split out onto a separate tab to make it easier to work with. For a Script Add-in, or when using the CLI in script mode, there is no Resources tab. Instead, script resources can be defined in two ways:

If BlahBlah Then
BlahBlah Blah
End If
==SCRIPT RESOURCES
<resources>
<resource name="blah1" type="dialog">
<dialog blah blah>
</dialog>
</resource>
<resource name="blah2" type="dialog">
<dialog blah blah>
</dialog>
</resource>
<resource type="strings">
<strings lang="blah">
<string id="blah" text="Blah!" />
</strings>
</resource>
</resources>

Everything before the line ==SCRIPT RESOURCES is considered part of the script code, and everything after it is the XML-formatted resources.