When you create a recording (or dashboard), a script is automatically generated that defines all the actions. You can edit the script and import it as a new script or script revision in Recorder Manager.
Note You should only modify scripts if you feel comfortable working with Progress code.
The following is a simple script that displays data from 1/15/20 to the current date in Sales Representative Analysis (eidlagin.p).
/*** Apprise Scripted Action ***/
{script.i}
PROCEDURE script-main:
OPEN_SCREEN("eidlagin.p","eidlagin-001").
SET_DATE("from-date","1/15/2020").
CHOOSE_BUTTON("button-show-data").
END PROCEDURE.
Notice that the script includes the following:
A comment on the first line. This is included in all generated scripts.
A reference to script.i, which includes function definitions. This is required for all scripts. You must also have the actual script.i file available.
A procedure called script-main, which includes all the indented code for the script. This is required for all scripts.
Three functions (OPEN_SCREEN, SET_DATE, and CHOOSE_BUTTON). Each function includes appropriate input parameters. For the SET_DATE function, the first parameter is the field that is being edited, and the second parameter is the value that is being put in this field. If you wanted to manually edit the script to set the date to 1/1/2020, you could simply change the 15 to a 1. For more information on functions and parameters, see below.
In recording scripts, functions control the actions that occur. Each function is followed by one or more parameters in parentheses. Each parameter is enclosed in quotation marks (except for logical values YES and NO and variable names) and separated from other parameters by commas.
The following table describes the functions you can use in scripts for recordings, and the parameters for each function.
Function |
Purpose |
Parameters |
OPEN_SCREEN |
Open a program.
|
Program name, alias Note The alias can be any string you want. You can reuse an alias in a recording script, but the previous program that was assigned the alias must already be closed. |
SCREEN_PARAMETER |
Set a parameter for opening a program. |
Parameter number, parameter type, parameter value, parameter name Note The parameter number must be an integer. |
GET_DIALOG |
Open a program from another program. |
Program name, alias Note The alias can be any string you want. You can reuse an alias in a recording script, but the previous program that was assigned the alias must already be closed. |
SELECT_SCREEN |
Select an open window. |
Program variable Note The program variable must be defined and assigned in the script. |
SELECT_TAB |
Select a tab in a window and trigger any events for the tab. |
Tab name Note This parameter can also be NONE if no tab is selected. |
CHOOSE_FIELD |
Click the Lookup button for a field. |
Field name |
CHOOSE_BUTTON |
Click a button. |
Button name |
SET_FIELD |
Enter a value in a field. |
Field name, value |
SET_CHECKBOX |
Select or clear a check box. |
Field name, check box state Note The check box state must be YES (selected) or NO (cleared). |
SET_DATE |
Enter a date in a date field. |
Field name, date NOTE A date can be a specific date or a description of a date, such as Today, Yesterday, Tomorrow, Today - 1 Week, This Quarter Begin, Last Period First, etc. |
ENTER_TAB |
Move to a tab and trigger events. |
Tab name |
ENTER_FIELD |
Move to a field and trigger any events. |
Field name |
SELECT_GRID |
Select a grid. |
Grid name |
RESET_GRID_SORT |
Reset a sorted grid. |
|
ADD_GRID_SORT |
Sort a grid by a column. |
Column name, direction |
SELECT_ROW |
Select a row in a grid. |
Row |
DBL_CLICK_ROW |
Double-click a row in a grid. |
|
ENTER_CELL |
Select a cell in a grid. |
Cell |
DBL_CLICK_CELL |
Double-click a cell in a grid. |
Cell |
EDIT_CELL |
Edit a cell in a grid. |
Cell, value |
EDIT_CHECKBOX_CELL |
Edit a check box in a grid. |
Cell, value |
ANSWER_DROPDOWN |
Select an option in a Lookup window or list of options. |
Lookup window/list name, key/selected value, browser output, browser output, selected value/browser output NOTE Browser output parameters are not always required. When you create a recording, you can see which parameters are used for a specific Lookup window or list of options. |
MANUAL_ANSWER_DROPDOWN |
Click the Lookup button for a field and allow the user of the recording to manually select an option. |
Lookup window/list name |
CANCEL_DROPDOWN |
Close a Lookup window or list of options without making a selection. |
Lookup window/list name |
ANSWER_MESSAGE |
Click a button in a message dialog box. |
Message number, message response Note The message number is the number that appears in parentheses in the message dialog box. The message response parameter must be YES or NO. |
OPTIONAL_ANSWER_MESSAGE |
Click a button in a message dialog box if it appears. |
Message number, message response Note The message number is the number that appears in parentheses in the message dialog box. The message response parameter must be YES or NO. |
ALWAYS_ANSWER_MESSAGE |
Always click the same button in a message dialog box. |
Message number, message response Note The message number is the number that appears in parentheses in the message dialog box. The message response parameter must be YES or NO. |
MANUAL_ANSWER_MESSAGE |
Allows the user of the recording to manually click a button in a message dialog box. |
Message number Note The message number is the number that appears in parentheses in the message dialog box. |
COPY_FIELD |
Copy the contents of a field. |
Field name, register Note You can only use this function with combo boxes, fill-in fields, and text boxes. You cannot copy from a radio button, date, or check box. This function can only be scripted manually. It cannot be recorded. |
COPY_CELL |
Copy the contents of a cell in a grid. |
Grid name, cell name, COPY |
PASTE_FIELD |
Paste the contents of a field. |
Register, field name Note You can only use this function with combo boxes, fill-in fields, and text boxes. You cannot paste to a radio button, date, or check box. This function can only be scripted manually. It cannot be recorded. |
PASTE_CELL |
Paste the contents of a cell in a grid. |
COPY, grid name, cell name |
VALIDATE_DATA |
Call a subprocedure that validates data. |
Subprocedure |
RUN_SCRIPT |
Run another recording script. You can use multiple instances of this function in a script to run multiple recordings. |
Script name |
FAIL_SCRIPT |
Abort a recording. |
Message NOTE This function can be used to abort a recording if a specified condition occurs using an IF/THEN statement in the recording script. The message is sent to the recording log file macro.log, created in the server's temporary folder. |
LOG_MESSAGE |
Send a message to the recording log file macro.log, created in the server's temporary folder. |
Message |
DASHBOARD_CHART |
Display a dashboard chart based on a charted grid. |
Grid name NOTE This is the grid that is being charted. |
CHART_X_AXIS |
Set the X-axis for a dashboard chart. |
Column name |
CHART_Y_AXIS |
Set the Y-axis for a dashboard chart. |
Column name |
DASHBOARD_GAUGE |
Display a dashboard gauge. |
Field name NOTE This is the field that is being measured in the gauge. |
FIELD_VALUE |
Get a field value. |
Field name |
CHECKBOX_VALUE |
Get a check box value. |
Field name |
DATE_VALUE |
Get a date value from a field. |
Field name |
OPEN_DATA_FILE |
Open a data file. The data file must be located in the folder entered in the User Data File Folder field on the Options tab in Recorder Manager. |
File name |
NEXT_DATA_LINE |
Go to the next line in a data file. |
|
Recording errors and messages are stored in macro.log, which is created in the server's temporary folder. Error messages in the log file describe problems in your script, and you can use the log file as a diagnostic tool to help you fix a broken recording script.