After you use a text editor to create a script file, and get connected with the host, you can run the script file from KoalaTerm menu:
Select "Run Script" from "Connection" menu, specify the file name, press OK, then the file will be loaded and executed in the context of current active terminal session.
With KoalaTerm 3.0’s key mapping feature, you are able to map a key (or combined with modifier keys) to execute a script file or a few script lines.
Here are detailed instructions:
After all these done, you can then simply press the key (with modifiers you selected), the script will be executed in context of current active session.
KoalaTerm includes a button palette, which can be shown at the bottom of the terminal screen. If you don’t see it, check "Button Palette" from "View" menu.
With KoalaTerm 3.0, there are totally 32 buttons you can define as an additional way to do input or execute scripts.
Here are detailed instructions on how to use buttons to execute scripts:
If you are a host programmer, you may found this way to run a KoalaTerm script very useful. Because KoalaScript has access to most of the terminal settings, it’s very convenient for host to send simple script lines over the connection and change many aspects of KoalaTerm simulation.
Hosts invoke KoalaScript by sending special sequences defined by KoalaTerm:
1. Activating a script file:
<ESC> P $ s <File Path> <ESC> \
Where "<File Path>" is the local path of the script file. If the file resides in the same directory as KoalaTerm does, you may specify only the file name.
Note: <ESC> is the ASCII 27 code. All spaces are added just for easier reading, you shouldn’t send spaces (except those in file name).
For example, the following sequence from host will run script "MyScript.kts" from the current KoalaTerm directory:
<ESC> P $ s MyScript.kts <ESC> \
2. Activating script commands Script-Commands:
<ESC> P $ t <Script Lines> <ESC> \
Where "<Script Lines>" is any KoalaScript lines. They may be separated by CR-LF or may not, doesn’t matter. See "KoalaScript Syntax" section for details.
Note: <ESC> is the ASCII 27 code. All spaces are added just for easier reading, you shouldn’t send spaces (except those in script lines).
For example: the following sequence from host will show a message box on the PC machine:
<ESC> P $ t sys.MessageBox("Hello!"); <ESC> \
Overview of KoalaScript Language