Is it possible to access objects defined in the Export Global Script Module within the Export Script?

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:

  1. Open the Export Script module by clicking Script Modules > Export Script…
  2. Select the Export Global Script Model (if another context is selected) and add code there.
  3. Save the updated script.
  4. Once done, open the Export Setting…
  5. Click Add… the new Export option.
  6. Select Custom export (script) > Next.
  7. Select the Export Script Module (if any other module is selected).
  8. 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.

Additional information

Export script

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.