Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Section


Column
width50%


Panel
borderColor#CCCCCC
bgColor#FFFFFF
titleBGColor#F0F0F0
borderStylesolid
titleOn the page:

Table of Contents



Column



To create and run scripts in JScript, create the Script system object. Then, in the Editor-Debugger utility, enter the script, check it and debug it.

You can create JScript scripts in Intellect using the built-in To create a JScript script in Intellect, the Editor-Debugger utility is used.

To start the Editor-Debugger utility, click the Editor-Debugger button in on the settings panel of the Script system object settings panel.

Creating the Script object

To create a scriptthe Script object in Intellect, do the following:

  1. In the Programming tab (1) of the System Settingssettings dialog window, create a Script object. the Script object (2).
  2. Enter the identification number and the name for the script.

    Select the time limits for running the script in the Time Zone field (for example, the Always zone).

    the Script object (3).
  3. Click the Apply button (4).
    Image Added

The settings panel of the Script object will open.

Image Added

To configure the Script object, set the values of the following parameters:

  1. In the Time schedule field (1), specify the time schedule of the script execution: Always, Never or one of the schedules created earlier (1, see Creating and configuring Time schedules). The default value is Never.

    Info
    titleNote
    By default, the Never time zone is selected

  2. In the Computers field (2), select the computers (kernels) where on which the script should must run.

    Info
    titleNote

    By default, the script will run on all computers (kernels). The list shows displays only the computers registered in the Hardware tab of the System Settings settings dialog window.


  3. Click the Apply button.

Creating and editing a script

To create a script in JScript in Intellect, do the following:

  1. Click the Editor-Debugger button in (3) at the bottom of the Script settings system object panel to open the Editor-Debuggerutility.

    Info
    titleNote

    Use the Editor-Debugger utility to create, edit and save scripts in JScript. The settings panel of the Script system object displays the text of the saved script available to that can also be edited is saved on the setting panel of the Script object.


  2. In the Editor-Debugger utility window, open the Script Debug/Edit-edit script list and select the Script object you want to be edited edit (for example, Script 2the Script 1 object, as in the figure below).

    Image Removed

    Image Added

  3. In the Script field, enter

    Enter

    the text of the script in JScript programming language

    into the Script field. Info
    titleNote.
    For convenience, the cursor position is stored when script is saved or when switching between scripts in Editor-Debugger during a session, i.e. until Intellect is restarted

    (see Examples of scripts in the JScript language).

  4. Run the script using a test event. To create a test event, select theselect Debug and edit → Edit test event in the Debug and edit menu.
    The Test message window will open allowing to set the test containing the fields for setting the event parameters. 
    Image RemovedImage Added

To run the script using the test event,

...

select Debug and Edit

...

Test run.

Info
titleNote

You can also run the script using the test event using the Ctrl+T key combination.

...

Also, use Ctrl+T hotkey to test-run the script by test event.

...

Features when working with a script

When working with a script in the Editor-Debugger utility, you can undo the last action or return the last action. To undo the last action, press the Ctrl+Z key combination. To return the last action, press the Ctrl+Y key combination.

Info
titleNote

For your convenience, when editing the script, the cursor position is saved when saving the script or when switching between the scripts in the Editor-Debugger utility window during a session, it means, until Intellect is restarted.


Info
titleNote

When you go to the Script messages list when editing a script, and then go back to the corresponding script in the Debug-edit script list, you cannot undo or return the last action.

Debugging a script

You can check if the script syntax is correct using the interpreter which is built-in into the Editor-Debugger utility. The

...

result of the check with the information about the content and location of the error is displayed in the

...

Debugger window corresponding to the script in the Script messages list.

...

If there are errors, you need to edit the script

...

syntax and check it again.

Info
titleNote

 See the detailed information about using test events for script debugging

...

in Script debugging.

After debugging the script using the Editor-Debugger utility, run it with a real system event. Check the result of the script execution. If the result is incorrect,

...

make the necessary changes and run the script again.

Script creation is considered complete if it runs correctly.