Skip to main content

IApplication.ExecuteScript Method

Namespace: NextDesign.Desktop

Description

Loads and executes the specified script file.

Identifies the scripting language from the extension of the specified script file.

  • ".cs" or ".csx": Executes as a CSharp script.
  • ".py": Executes as a Python script.

In V5.0, an exception is thrown if a file with an extension other than those listed above is specified.

Argument

NameTypeDescription
scriptPathstringAbsolute path to the script file
scriptParamsIScriptParamsScript parameters

Return value

  • object

Exception

NameException ClassDescription
Invalid ArgumentExtensionArgumentExceptionWhen null is specified for the script file path
When an extension not supported by the script file path is specified
File Not FoundExtensionFileNotFoundExceptionWhen a path where the file does not exist is specified for the script file path
Script Execution FailedExtensionScriptExceptionWhen script execution fails
(InnerException allows access to the exception that caused the failure)