Scripting Projects in UModel Print this Topic Previous Page Up One Level Next page

Home >  UModel Programmer's Reference > Scripting Editor > Overview >

Scripting Projects in UModel

All scripts and scripting information created in the Scripting Editor are stored in Altova Scripting Projects (.asprj files).


You can create any number of Altova Scripting Projects. After a scripting project has been created, it can be used in the following ways:


It can be set as the global scripting project for UModel. Scripts in the global scripting project can then be called from within the application, and macros of the Global Scripting Project can be used for all UModel projects.
It can be assigned to an UModel project (as an application project). When an UModel project is open in UModel, scripts in the associated scripting project can be called.


Your UModel package contains a sample scripting project called ScriptSampleFind.asprj. This file contains global declarations for a few standard tasks and is located in the folder: C:\Users\<username>\Documents\Altova\UModel2019\UModelExamples\Scripting.



Setting the global scripting project of an application

The global scripting project of an application is set in the Scripting tab of the Options dialog of UModel (screenshot below, Tools | Options).




To set a global scripting project for UModel, check the Activate Scripting check box and then browse for the Altova Scripting Project (.asprj) file you want. You can also specify: (i) whether Auto-Macros in the scripting project should be automatically executed when UModel starts, and (ii) whether application event handler scripts in the project should be automatically executed or not; check or uncheck the respective check boxes accordingly.


Note:Nested script execution is possible, i.e. Macros can call other macros, and events are received during macro, or event, execution.




Assigning a scripting project to an UModel project

A scripting project is assigned to an UModel project as follows:


1.In the UModel GUI, open the required application project.
2.Select the menu command Project | Project Settings | Scripting then click the Scripting tab.




3.Check the Activate Project Scripts check box and select the required scripting project (.asprj file). If you wish to run Auto-Macros when the UModel project is loaded, check the Run Auto-Macros check box.
4.Click OK to finish.


Note:To deactivate (that is, unassign) the scripting project of an UModel project, uncheck the Activate Project Scripts check box.


© 2019 Altova GmbH