Meridian Enterprise Script Editor

The Meridian Enterprise Script Editor is a simple text editor for entering VBScript code. The code you create is saved in your Meridian vault configuration. Configuration expressions are saved as individual code blocks, and the Meridian event procedures code is saved as one code block.

The Meridian Enterprise Script Editor can help you to build correct VBScript code by listing all available objects, functions, and constants for easy selection. As you enter VBScript code in the code pane, the Meridian Enterprise Script Editor constantly monitors the syntax of your code. When the current code is correct, the status bar displays Script is valid. If the syntax of the current code is incorrect, the status bar displays the error and the location of the error so that you can easily correct it.

If you are entering a configuration expression, when you are finished entering code, you can test the code by clicking the Evaluate the expression button Button that looks like a calculator.. The Meridian Enterprise Script Editor will evaluate the expression and display the result so that you can confirm that the result is what you expect.

We include many examples of code that can be implemented in the VBScript Editor in our documentation. If you need assistance with your implementation, reach out to your Accruent representative.

ClosedEdit VBScript Code

Not all options described below will be available in every instance of the VBScript Editor. Learn more about the VBScript Editor user interface below.

To edit a code block:

  1. Open the VBScript Editor.

    You can do this in one of three ways:

    • Click the Edit Events button An icon depicting a pencil and paper. in the toolbar at the top of the Configurator screen.

    • Click the Edit Events button next to the place in the Configurator where the code block is applied.

    • Click the Meridian Enterprise Script Editor button A square button with the letters "fx" on it. next to a place where configuration expressions can be applied.

  2. To enable syntax coloring, select the Use syntax coloring check box.

    This check box appears at the bottom of the Script Editor pane. The performance of loading large scripts can be improved by disabling this option.

  3. To enable the out-of-the-box script validation functionality, select the Use validation check box.

    This check box appears at the bottom of the Script Editor pane. When this check box is selected and the current code is correct, the status bar displays Script is valid. If the syntax of the current code is incorrect, the status bar displays the error and the location of the error so that you can easily correct it.

  4. Use the editor to write your custom code.

    • To add an object to your code:

      1. Select the object from the Object Browser menu.

        The Script Editor enters the object name in the editing pane.

      2. To delineate a subclass of the current object, type a period after the object name.

        The Script Editor displays a popup list of the current object's properties and methods for you to select.

      3. If you want to use an object method:

        1. Select a method name from the list.

        2. Type an open parenthesis.

          The editor shows a tooltip in the code pane of all required and optional parameters to assist you.

        3. Provide values for any parameters that you want to use.

        4. Ensure that all required parameters are specified.

        5. Type a close parentheses.

        6. Repeat as necessary.

    • To add an event or function to your code, select it from the Events and Procedures menu.

    We include many examples of code that can be implemented in the VBScript Editor in our documentation. If you need assistance with your implementation, reach out to your Accruent representative.

  5. To test a configuration expression, click the Evaluate the expression button Button that looks like a calculator..

    This button only appears in the Script Editor for configuration expressions. Learn more about configuration expressions.

    The Meridian Enterprise Script Editor will evaluate the expression and display the result so that you can confirm that the result is what you expect.

  6. Once you are satisfied with your code, click OK.

ClosedUser Interface

The following diagram and tables are used to describe the VBScript Editor user interface.

A screen shot of the script editor with five labels pointing to different parts of the editor. A description of each part is in the table below.

The Meridian Enterprise Script Editor is composed of several elements described in the following table.

Features of the VBScript editor
Number Name Description

1

Toolbar

Contains buttons for transferring text with the Clipboard and searching code for text.

2

Object Browser

Displays a tree view of the VBScript built-in functions and constants, and the Meridian objects, properties, methods, functions, and constants. For information about the Meridian objects, see Meridian Object Model. For information about the Meridian functions, see Meridian functions.

3

Code pane

The area for entering VBScript code.

4

Events and Procedures

Displays a tree view of the Meridian events and any custom functions that have been defined. For information about the Meridian events, see Meridian event procedures. This view is only available when editing the Meridian events, as described in Create and Edit Event Procedures.

5

Status bar

Displays indicators for the current script's validity (if the Use validation option is enabled) and the current cursor position. The performance of loading large scripts can be improved by disabling Use syntax coloring option.

The commands for each icon on the toolbar are described in the following table.

Toolbar icons
Icon Shortcut Description

Button that looks like a piece of paper with an arrow pointing to the right.

Ctrl + O

Load a file from disk to completely replace the current code block. Available only when editing the Meridian events, as described in Create and Edit Event Procedures.

Button that looks like a floppy disk.

Ctrl + S
F12

Save the current contents of the editor to a file on disk. The default file name that is calculated includes the current date. Available only when editing the Meridian events, as described in Create and Edit Event Procedures.

Button that looks like a pair of scissors.

Ctrl + X

Cut the selected text to the Clipboard.

Button that looks like two pieces of paper.

Ctrl + C

Copy the selected text to the Clipboard.

Button that looks like a clipboard with a piece of paper attached.

Ctrl + V Paste text from the Clipboard.

Button that looks like a pair of binoculars.

Ctrl + F Find specific text in the current code block. Available only when editing the Meridian events, as described in Create and Edit Event Procedures.

Button that looks like an arrow pointing right on a green background.

Ctrl + G Go to a specific line number in the current code block.

Button that looks like a calculator.

 

Evaluates a configuration expression and displays the result so that you can confirm that the result is what you expect.

This button only appears in the Script Editor for configuration expressions. Learn more about configuration expressions.

2023