Altova StyleVision 2024 Enterprise Edition

Creating a Scripting Project

Home Prev Top Next

All scripts and scripting information created in the Scripting Editor are stored in Altova Scripting Projects (.asprj files). A scripting project may contain macros, application event handlers, and forms (which can have their own event handlers). In addition, you can add global variables and functions to a "Global Declarations" script—this makes such variables and functions accessible across the entire project. To start a new project:

 

1.Create or open the .sps file that the scripting project should be part of.

2.Do one of the following:

On the Authentic menu, click Authentic Scripts.

Click the Design tab at the base of the main window, and then select Authentic Script.

 

Each .sps file can have a single scripting project assigned to it. To open an existing scripting project associated with an .sps file, follow the same instructions as above. This opens the Scripting Editor window. As you edit the scripting project, you can temporarily save changes in memory, by clicking the Save button at the base of Scripting Editor . To save the scripting project to disk, first click Save & Close in Scripting Editor, and then save the .sps file.

 

The languages supported for use in a scripting project are JScript and VBScript (not to be confused with Visual Basic, which is not supported). These scripting engines are available by default on Windows and have no special requirements to run. You can select a scripting language as follows:

 

1.Right-click the Project item in the upper-left pane, and select Project settings from the context menu.

2.Select a language (JScript or VBScript), and click OK.

scr_select_language

From the Project settings dialog box above, you can also change the target .NET Framework version. This is typically necessary if your scripting project requires features available in a newer .NET Framework version. Note that any clients using your scripting project will need to have the same .NET Framework version installed (or a later compatible version).

 

By default, a scripting project references several .NET assemblies, like System, System.Data, System.Windows.Forms, and others. If necessary, you can import additional .NET assemblies, including assemblies from .NET Global Assembly Cache (GAC) or custom .dll files. You can import assemblies as follows:

 

1.Statically, by adding them manually to the project. Right-click Project in the top-left pane, and select Add .NET Assembly from the context menu.

2.Dynamically, at runtime, by calling the CLR.LoadAssembly command from the code.

 

The next sections focus on the parts that your scripting project may need: global declarations, macros, forms, and events. For further information about scripting and examples of scripting projects, see Authentic Scripting.

© 2017-2023 Altova GmbH