Question
Is it possible to access objects defined in the Export Global Script Module within the Export Script?
Answer
Yes, it is possible to access methods/objects defined in the Export Global Script Module.
This module can be used in the same way as the Rule Global Script Module – that is, to create classes inside it. Generally, the Export Global Script Module is intended for sharing code between several export scripts inside one document definition.
In order to make any method/object available within the Export Script, please proceed with the following actions:
- Open the Export Script module by clicking Script Modules > Export Script…
- Select the Export Global Script Model (if another context is selected) and add code there.
- Save the updated script.
- Once done, open the Export Setting…
- Click Add… the new Export option.
- Select Custom export (script) > Next.
- Select the Export Script Module (if any other module is selected).
- Add the corresponding reference and re-save the script:
Once done, it will be possible to successfully use the class and its methods specified in the Export Global Script Module inside the Export Script.
However, if classes and methods of an external assembly are used in the script or global module, the assembly file must be attached to the .Net References tab of the Document Definition properties.
Comments
0 comments
Please sign in to leave a comment.