Script Editor

The Script Editor enables you to edit scripts, and to run, debug and stop an open script.

The editor is based on, and provides the facilities of, the common Code Editor. The editor opens in the main work area.

Access    Tools | Scripting > Scripts: double-click on script name

Use to

Save changes to the current script
Save the current script under a different name
Run the script
Debug the script
Stop the executing script
View the script output in the Scripts tab of the Output window

Topics

Topic

Detail

See also

Enterprise Architect Script Objects

Enterprise Architect adds to the available functionality and features of the editor script language by providing inbuilt objects; these are either Type Libraries, providing intellisense for editing purposes, or Runtime objects, providing access to objects of the types described in the Type Libraries.

The available intellisense scripting objects are:

EA
MathLib
System
The runtime scripting objects (below)

 

The available runtime scripting objects are:

Repository ( Type: IDualRepository )  - this is the Enterprise Architect Automation Interface
Maths ( Type: IMath  )
Session ( Type: ISession  )

 

Automation Interface

Script Debugging

Script Editing Intellisense (Required Syntax)

Intellisense is available not only in the Script Editor, but also in the Script Console; Intellisense at its most basic is presented for the inbuilt functionality of the script engine.

For intellisense on the additional Enterprise Architect scripting objects listed above, you must declare variables according to syntax that specifies a type; it is not necessary to use this syntax to execute a script properly, it is only present so that the correct intellisense can be displayed for an item.

The syntax can be seen in, for example:

 

Dim e as EA.Element

 

Then when you type, in this case, e., the editor displays a list of member functions and properties of e's type.

You select one of these to complete the line of script; you might, therefore, type:

 

VBTrace( e.

 

As you type the period, the editor presents the appropriate list and you might double-click on, for example, Abstract; this is inserted in the line, and you continue to type or select the rest of the statement, in this case adding the end space and parenthesis:

 

VBTrace( e.Abstract )

 
 

 

Keystrokes

In the Script Editor or Console, intellisense is presented on the following keystrokes.

Press ( . )  (period) after an item to list any members for that item's type
Press ( Ctrl ) + ( Spacebar )  on a word to list any intellisense items with a name starting with the string at the point the keys were pressed
Press ( Ctrl ) +( Spacebar )  when not on a word to display any available top level intellisense items - these are the intellisense objects described above plus any built-in methods and properties of the current scripting language.

 

 

Notes

This facility is available in the Corporate, Business and Software Engineering, Systems Engineering and Ultimate editions
Enterprise Architect's scripting supports declaring variables to match the Enterprise Architect types; this enables the editor to present intellisense, but is not necessary for executing the script

Learn more