ScriptPro Editor

This topic is for use by scriptwriters who are using ScriptPro Editor to create custom scripts for their agencies.

Agents can go to Using ScriptPro Scripts for more information about using custom or standard scripts within Travelport Smartpoint.

 

ComboBox, ListBox, ValidBox, SingleList, and MultiList Controls

Listbox control

A ListBox control provides an input field like an edit control, but has an associated list that drops down. The main difference between the list options is the behavior when running the script.

Creating a ListBox control and associated attributes

  1. Right-click anywhere in the background of the dialog box.

  2. Select ListBox. A new control will be added.

  3. Adjust the colors and text in the Appearance section. The default color for a ListBox is background white and the font color black.

  4. Use ControlType in the Behavior section to set the edit variable type.

    If a default selection is preferred, input the SelectedItem field with the corresponding value from your list file. Enter a VariableName to be used in your script code.

  5. You can place the following three conditions on each of the input fields.

    • The FileName is the name of the list file to be displayed in the box.

      The default path is the PROD folder and it is suggested you create your list file prior to creating the control.



    • Dynamic FileNames can be created by using a variable for the FileName.

    • If a default selection is preferred, input the SelectedItem field with the corresponding value from your list file.

    • Enter a VariableName to be used in your script code.

    Must-enter, must-fill, and conditions can be used in conjunction with a ListBox control.

  6. Select a ListBoxType in the Behavior section.

    The following ListBoxTypes are available.

    ListBoxType

    Description

    ListBox

    Only the information shown in the associated list can be entered by the script user into the input field. A selection can be entered in the ListBox by selecting it with the mouse, pressing the down arrow keys to select, or typing the string of characters exactly matching an entry in the list.

    Notes:

    • A ListBox is initially displayed as a single line. Upon entering the ListBox field, the ListBox automatically drops down. It returns to a single line when focus moves to another input field. The ListBox is the most restrictive.
    • When displaying a ListBox, it will show as a drop-down at the height set in the control.

    ComboBox

    A ComboBox control allows the script user to type in data or select it from the list. If data is typed in, it doesn't have to match a list item, but must match the stipulated input type (i.e., text, numeric, date, or airdate).

    Note: ComboBoxes are initially displayed as a single line. The list is not displayed automatically, but can be displayed by clicking the mouse on the down-arrow or pressing <Alt + Down Arrow>. The ComboBox control is the least restrictive.

    ValidBox

    ValidBox controls work like a combination ComboBox and ListBox. The input types are restricted to Text, Numeric, Date, and AirDate.

    Note: Must-enter, must-fill, and conditions can also be applied.

    The script user can type in data or select it from the list. Any data entered in this field is validated against the list. If user input does not match an item from the list, the list will drop down to allow the user a choice of entries.

    ValidBoxes are initially displayed as a single line. The list is not displayed automatically, but can be displayed by clicking the mouse on the down arrow, pressing <Alt + Down Arrow>, or typing a character which is not included in the list file.

    SingleList

    A SingleList control is a windows-style, single-selection ListBox that allows the script user to select data (i.e., text, number, date, airdate) from the list. The first letter of an item may be entered to highlight the first item beginning with that letter. Successive typing of that letter allows scrolling though all items beginning with that letter.

    The scriptwriter controls the height on the ListBox, and a scroll bar automatically displays when the list is longer than the selected height. Only items on the list are valid entries. Must-enter and conditions can also be applied.

    TIP: A "Clear" button is suggested to clear the field if an item is selected in error.

    MultiList

    Similar to the SingleList text, MultiList is a windows-style, multiple-selection ListBox that allows the script user to select more than one item from the list. The first letter of an item may be entered to highlight the first item beginning with that letter. Successive typing of that letter allows scrolling though all items beginning with that letter.

    To select multiple items:

    • Press the <Control> key while using the mouse to click selections.
    • Press <Shift>+<F8> to use the space bar in combination with the arrow keys.

    Note: Scriptwriter must code for multiple selections using a pipe ("|", <Shift>+backslash) character as the separator. Items selected from a MultiList selection list are returned to the script in list order, not by order of selection.

    Scriptwriter controls the height of the ListBox. A scroll bar automatically displays when the list is longer than the selected height. Only items on the list are valid entries; however, must-enter and conditions can also be applied.

    TIP: A "Clear" button is suggested to clear the field if an item is selected in error.

ListBox examples

The following example shows ListBoxes in the editor. Notice the height for each box is declared the same.

The following example shows the dialog box as it is seen while running. Notice how each box displays differently.

Note: Yellow was the default color on the ListBox; therefore, the drop-down is open and the color is selected.

List files

See List Files for information on creating files that contain lists associated with the above control types.