Macros are a sequence of simple instructions for an application to perform. You can usually record a series of actions and save them as a macro. When you want your application to perform the instructions you have stored in a macro, you can execute, or run the macro as if it were a small program or just another option available to you within your application. Macros work well to automate repetitive and time-consuming tasks.
Macros format commands by placing the command within brackets (e.g. [tab]). These commands appear in a series, one after another, in order to show the sequence of steps the program should take. Create and run macros through CTCBridge. Visual Underneath Studio will also run macros when they are specified as part of an action code.
See Macro and Script Codes below for the possible contents of the macro brackets ([ ]).
Scripts are brief instructions saved at text files in the MultiBridge directory that automate the process of interaction between a user and a host. The accepted script extension is .scr. People commonly use scripts to automate the process of signing on to and off of a host. Scripts, unlike Macros, have the capability of anticipating and waiting for prompts from your host. Only system administrators can create or edit scripts.
Script commands are formatted by typing a command, followed by a colon (:), and usually followed by additional information. You can create and run scripts through CTCBridge. Visual Underneath Studio will also run scripts when they are specified as part of an action code.
Scripts have some functionality that macros do not. The commands for these functions are as follows:
Display: |
The display command shows what message will appear in the status bar for users to see at a given time. To inform your user that the applet is automatically signing them onto the host while they wait, type the following line “Display: Automatically Signing on”. You can include such messages as a courtesy to your users and as a possible debugging tool. |
Option: |
Values are either + to turn on or - to turn off the attendant option. The options include: QUIET (default-) if on, show nothing on the screen so the user does not see what is happening. FILTER (default+) if on, check filters. REQUIRE (no default) sets value of RequireScreenMatch property. |
Prompt: |
This command will present the user with an alert dialog box, which displays the text of the message you type after the colon. The script halts until the user clicks on the [OK] button on the alert box. |
Receive: |
Specifies the text transmitted from your host. For example, if you want to wait until you receive a message containing a pound sign "#" from your host computer before your script does any further action, you would enter "Receive:#". Startup scripts usually begin with a command to receive some text or character from your host computer. |
Sleep: |
This command will halt the script for the period of time, in seconds, you specify as an integer number after the colon. CTCBridge does not stop running when the script stops, however, and the user can continue normal terminal emulation. |
Var: |
This command is followed by the name of a variable. The text contained in the named variable will be written to the screen at the current cursor location. Create variables in the users.mbf file or through the use of the Visual Underneath Studio command “Get.” See Visual Underneath Studio documentation for more information. |
Write: |
Writes, as if typed by the user, the text following the colon at the current cursor position. |
macrocommand: |
A macro command followed by a colon will run. See below for a list of macro commands. |
; |
By itself at the beginning of a line, a semicolon designates the following text as a remark that exists only for the benefit of someone editing or reading the actual script file. For example, the following line, by itself, would not perform any action within a script, ";Use the line below to connect". |
CTCBridge allows you to create three kinds of scripts:
Startup scripts (extension .sco) execute when the user first opens a station. They work well to automate the process of signing on to your host.
End scripts (extension .scc) run when the user closes a given environment. You close an environment by selecting the [Exit] button, or "Close Environment" or "Exit from all Environments" from the File menu. The end script then runs to automate the process of logging off of the host.
User scripts (extension .scr) run after a user begins using the applet. User scripts are not associated with any particular SIM station, and you can name them anything you want. User scripts work well to automate the processes of signing off from your host computer or any series of repetitive terminal host communication actions.
Startup Scripts
A startup script is meant only to work with a particular SIM station. You give a startup script the exact name as the SIM station it works with and add the extension ".sco". The “o” in the extension stands for “opening.”
For example, if you wanted to make a script for any user who connects to MultiBridge using the DEFAULT SIM station, you would name that script "DEFAULT.sco" and store it within the JT27 subdirectory of MultiBridge.
End Scripts
An end script also only works with a particular SIM station. You give an end script the same name as the SIM station it affects and add the extension ".scc". Save this script in the same way as the startup script but with the “.scc” extension. The “c” in the extension stands for “closing.”
User Scripts
User scripts are available to all users and are not associated with any particular SIM station. Users can run a user script through the Run Script window of CTCBridge. You can also assign a script to a user-defined button through the Assign Buttons options of the Configure menu or with Visual Underneath Studio. Use the extension “.scr” for user scripts.
Below you will find a list of the script and macro codes that you can use to create and edit your own macros and scripts, along with any corresponding menus and keyboard sequences. Macro and script codes are not case sensitive meaning you need not worry whether or not you capitalize them.
You store scripts and macros in the JT27 subdirectory of your MultiBridge directory, usually c:\ctccore\mbridge\JT27.
Below is a list of the codes you can use in either scripts or macros.
ArrowDn |
This code performs the same action that occurs when you press the down arrow key on your keyboard. |
ArrowLf |
This code performs the same action that occurs when you press the left arrow key on your keyboard. |
ArrowRt |
This code performs the same action that occurs when you press the right arrow key on your keyboard. |
ArrowUp |
This code performs the same action that occurs when you press the up arrow key on your keyboard. |
BackSpace |
This code performs the same action that occurs when you press the backspace key on your keyboard. |
BackTab |
This code performs the same action that occurs when you press the shift and tab keys on your keyboard. |
Bound |
This code binds the end of a piece of text on the terminal screen. |
Capture |
This code captures the currently displayed screen. |
CfgAssignButtons |
This code opens the Button Assignment window. |
CfgChange Environment |
This code opens the Change Environment window. |
CfgAssignEvent |
Opens the Assign Event window. |
CfgColors |
This code brings up the Color Setup window. |
CfgCutAndPaste |
This code opens the Cut and Paste Options window. |
CfgDataComm |
This code opens the Datacomm Setup window. |
CfgDeleteEnv |
This code opens the Delete Environment window. |
CfgGeneral |
This code opens the General Setup window. |
CfgKeyboard |
This code opens the Keyboard Setup window. |
CfgKeyXlt |
This code brings up the Keyboard Translations window. |
CfgOpenEnvironment |
This code opens the Open Environment window. |
CfgSaveConfigAs |
This code performs the same actions as the Save Configuration As… option of the File menu. |
CfgScreen |
This code opens the Screen Setup window. |
CharMap |
This code brings up the Character Map window. |
CloseWindow |
This code works the same as the [Close] button in a separate window environment. |
Close1 to Close20 |
These codes close the designated environment. |
ClrCB |
This code clears the clipboard of all contents. |
ClrEOL |
This code clears to the end of a line. |
ClrEOP |
This code clears to the end of a page. |
ClrHome |
This code clears all the text from a display from cursor location back to the home position. |
Copy |
This code performs a copy command. |
Cr |
This code performs the same action as a keyboard carriage return. |
CrInMem |
This code writes a carriage return to memory. |
Ctrl |
This code is a control function. |
Cursor |
This code specifies the row and column at which to place the cursor. |
Cut |
This code performs a cut command. |
Debug |
This code opens the Trace Options window. |
DelChar |
This code deletes an individual character within a line or field. |
DelCharPage |
This code deletes the character at the cursor position. All characters to the right of the cursor to the end of the page or field will shift left one space to fill the vacuum. If necessary, the first character of the next line will wrap up to the end of the present line to conserve space. This command creates a blank space at the end of the page or field. |
DisableFormsMode |
This code disables the forms mode on the applet screen. |
DlgUserPass |
Opens a dialog for the user to enter their user name and password. After the user has entered the information and presses the [OK] button, the current script continues. However, if the user clicks Cancel on this dialog, the current running script will be aborted. If the administrator would like some other script to be run in the case of the Cancel button being pressed, the name of that script should be entered as a parameter to DlgUserPass: For example: DlgUserPass:cancelscript.scr |
DoubleZero |
This code inserts a 00. |
EditScript |
Opens the Manage Scripts window. |
EnableFormsMode |
This code enables the forms mode on the applet screen. |
Home |
This code performs the same action as the [Home] key. |
InfoAbout |
This code opens the About window you might normally access through the Help menu. |
InfoCtrlCharacter |
This code brings up the Control Character window. |
InfoHelp |
This code opens a separate copy of your Web browser application for you to view the online help. |
InfoLanguage |
This code allows you to choose the language files for the applet. |
InfoOpt |
This code performs the same action as pressing the [Menu] button in the Web page environment. |
InsChar |
This code allows the emulator to place characters within a given line so that the characters to the right of the cursor will move right one space to accommodate each new character. |
InsCharPage |
This command will insert a space at the present cursor position, and shift all characters within the field or display to the right one space to fill the vacuum. The characters at the end of a line will wrap around to the beginning of the next line. However, you will lose any characters at the end of a field. |
InstJPrint |
This code installs JPrint. |
LineDel |
(Delete Line) This code deletes the entire line the cursor is on. All subsequent lines shift up one row to fill the vacuum, creating a blank line at the bottom of the screen (the 24th line). |
LineIns |
(Insert Line) This code inserts an entire blank line in place of the line the cursor is on. All subsequent lines, and their field control characters, move down one row on the screen to make space for your new line. You will lose the last (24th) line as it appears to “fall off” the bottom of the screen. |
LineMovementDn |
This code activates line movement down. |
LineMovementUp |
This code activates line movement up. |
LineXMT |
This code transmits a line. |
Local |
This code moves the applet over to local mode. |
LockCtrl |
This code activates lock control. |
Log |
This code brings up the Log Message window. |
LogicalEOL |
This code moves the cursor to the end of the line, which is first space after the last non-blank character. |
LogCounter |
This code adds a log point message to the Java console. |
Mark |
This code marks the beginning of a section of text on the terminal screen. |
ManageMacros |
This code opens the Manage Macros window. |
NewConfig |
This code performs the same action as selecting New Configuration from the File menu. |
NewWindow |
This code performs the same action as clicking on the [New] button to create a new separate window environment. |
NextEnv |
This code moves the focus to the next environment. |
NextPage |
This code moves the screen to the next page in the same environment. |
NextWord |
This code moves the cursor to the beginning of the next word. |
Open1 to Open20 |
This code opens the designated environment. |
OpenConfig |
This code performs the same action as selecting Open Configuration from the File menu. |
OpenWeb |
This code will open a web environment. |
Paste |
This code performs a paste command. |
Pause |
This code pauses the execution of a script or macro until the next time the emulator receives information from your host. |
PrevEnv |
This code moves the focus to the previous environment. |
PrevPage |
This code moves the screen to the previous page in the same environment. |
PrevWord |
This code moves the cursor to the end of the previous word. |
PrintAll |
This code prints the contents of the entire screen. |
PrintHTML |
This code instructs CTCBridge to open a new copy of the Web browser application containing the contents as text, which you can print through the browser's print command. |
PrintFields |
This code prints field data only. |
PrintUp |
This code prints field data to the default printer. |
QuickPrint |
This code prints the contents of the screen without first showing JPrint® users a print dialog box. |
RCV |
This command puts the terminal screen into Receive Mode. |
Recall |
This command pastes text from the terminal screen that has already been marked, bound, and stored. |
Reconnect |
This code reconnects you to your host computer. |
RepaintScreen |
This code repaints the present display with the most recent information from your host computer. |
RestoreForm (Script ONLY) |
This code will paint the specified form file (RestoreForm: formfile.frm) to the terminal screen. |
RollDn |
This code performs a roll down command. |
RollUp |
This code performs a roll up command. |
RunMacro |
This code is equivalent to selecting Run Macro from the Macro menu. |
RunScript |
This code is equivalent to selecting Run Script from the Macro menu. |
SaveConfig |
This command performs the same action as the Save Configuration option of the File menu. |
SaveForm (Script ONLY) |
This command will save the current screen into a form file for later retrieval. |
SelDn |
This command is the same as pressing both the shift and down arrow keys to select an area of text on the display. |
SelEnd |
This command is the same as pressing both the shift and [End] key to select an area of text on the display. |
SetReverseVideo |
This command reverse the fore and background color choices on the Color Setup window. |
SelLf |
This command is the same as pressing both the shift and left arrow keys to select an area of text on the display. |
SelRt |
This command is the same as pressing both the shift and right arrow keys to select an area of text on the display. |
SelUp |
This command is the same as pressing both the shift and up arrow keys to select an area of text on the display. |
ShiftTab |
This command is the same as pressing the shift and tab keys at the same time. |
Specify |
This code sends a specify command to the host asking the host for a description of the item at the current cursor position. |
StartMacroRecording |
This code begins recording a macro. |
StopMacro |
This code halts execution of a macro. |
StopMacroRecording |
This code halts the recording of a macro. |
StopScript |
This code halts the execution of a script. |
Store |
This command stores a marked and bound section of text from the terminal screen. |
Tab |
This command is the same as pressing the tab key. |
ToggleForms |
This code toggles forms mode on and off. |
ToggleRvs |
This code toggles to the reverse screen. |
ToggleTab |
This code creates a variable tab. |
TraceScreen |
This code traces the screen. |
TraceStatus |
This code displays the trace status. |
Transmit |
This code Transmit data from the cursor or Start of Entry position. When you are working with a page that offers control options, you can click this button when the option you want to select is beneath the cursor. This will execute that option. You can only transmit data when “POLL” appears on the indicator line. |
TripleZero |
This code indicates 000. |
UserExit |
This command performs the same action as clicking the [Exit] button in the Web page environment or selecting Exit from all Environment from the File menu. |
WriteESC |
This code writes an ESC in the memory. |
WriteETX |
This code writes an ETX in the memory |
WriteGS |
This code writes a GS in the memory. |
XLTTab |
This code opens the Character Translations window. |