|
Archive for the 'Scripting' Category
Monday, March 12th, 2007
When building strings in TERM Script Language or TinyTERM’s CScript, you may need to enter non-printable characters. Also, the \ and @ characters are reserved for special functions normally, but you may need them as literals instead. In fact, the backslash character \ allows you to enter the non-standard characters like so:
^ |
control character; e.g., ^X for Ctrl-X |
\b |
backspace (hex 08) |
\e |
escape (hex 1b) |
\f |
form feed (hex 0c) |
\n |
line feed (hex 0a) |
\r |
carriage return (hex 0d) |
\t |
horizontal tab (hex 09) |
\v |
vertical tab (hex 0b) |
\@ |
at sign (hex 40) |
\^ |
carat (hex 5e) |
\ |
backslash (hex 5c) |
“ |
double quote (hex 22) |
‘ |
single quote (hex 27) |
\x |
hexadecimal number follows; e.g., \x1b for escape |
\0 thru \7 |
octal constant follows; e.g., \024 for Ctrl-T |
All the above may be used together to specify complex strings. In addition, you can use the / character to separate directories in any version of TERM or TinyTERM; e.g.,
setvar sample_path “C:/Temp”
CR 710
Posted in Scripting | Comments Off on Special String Characters in Script
Thursday, March 8th, 2007
You may need to change the number of columns displayed in TinyTERM manually during an active session. Rather than changing the Session Properties every time, TinyTERM version 4 can do this with a single keystroke.
Open the Session Properties and go to the Keyboard tab. Click the Edit button to bring up the keyboard map. In the map, click on the key you want to use. Change the Action field to COMMAND. In the Value field, type this as one long string:
if(teobj.NumColumns==80) {teobj.NumColumns=132; eobj.redraw();} else {teobj.NumColumns=80; teobj.redraw();}
Click the Set button, then close the keyboard map. On the Keyboard tab, click the Save As button to give the new keyboard scheme a name. OK everything and save the session. Hitting the selected key will switch the number of columns displayed between 80 and 132 columns on the fly.
Posted in CScript, Windows | Comments Off on Switching Number of Columns on a Keystroke
Wednesday, March 7th, 2007
Sometimes users will close TinyTERM when they’re done, instead of properly logging out of the host first. This can use up concurrent server licenses, or even corrupt the host database. For TinyTERM version 4.10 or higher, you can prevent this.
In the TinyTERM directory, you’ll find a sample script named outfirst.cs. It will work for network or modem connections, but not direct serial connections. RS232 connections actually connect only to the serial port in the PC, which then gets information from the line connecting it to the host. Logging out of the host does not end a serial connection the way it does over a network or modem.
To use outfirst.cs, open TinyTERM on the user’s PC. Go to the Edit menu and select Preferences. Next to the Application startup script line you’ll see a Browse button. Click on that and use the resulting Windows Find dialog to locate the outfirst.cs script. Select that script and click the Open button to make it the application startup script.
This will take you back to the Preferences dialog. Click the Apply and OK buttons. Go to TinyTERM’s File menu and select Save Session. The next time TinyTERM is started, a warning message will pop up whenever a user tries to close TinyTERM before logging out. TinyTERM will stay open and connected when the error is closed.
For screen-by-screen help with this configuration, please view our screencast on this topic.
There is one way around the outfirst.cs. If you shut down Windows, it bypasses the shutdown blocks running in TinyTERM.
CR 554
Posted in CScript, Screencast | Comments Off on Users Close TinyTERM Before Logging Out
Friday, March 2nd, 2007
This is normal behavior when “backspace sends delete” is turned on. It can also cause the last character in some text entry fields to disappear. Turning it off depends on which product you’re using:
TERM for UNIX or DOS
Execute this TERM Script Language command:
SET BSDEL OFF
TinyTERM for Windows version 3.x or earlier,
and TERM for Windows
Go to the Configure menu and select Emulation. Clear the BACKSPACE key sends DELETE check box.
TinyTERM for Windows version 4.0x
Edit the .tpx file using any text editor. Search for the line:
destbs=1
Change the 1 to a 0 (zero). Save the file. The change will take effect the next time you start TinyTERM.
TinyTERM for Windows version 4.1x or higher
In the Session Properties, go to the Keyboard tab. Clear the Destructive Back Space check box.
CR 98, default changed in TinyTERM 4.20
CR 160, .tpx files changed
CR 375, UI added
Posted in Keyboard, TSL | Comments Off on Left Arrow Erases Characters
Wednesday, February 28th, 2007
Using the keyboard mapping function, you can configure a key to send a BREAK signal. By default, this is mapped to ^B in TERM for DOS or UNIX. You can change that with the SETKEY script command. For example, to set F10 as the BREAK key, the command is:
setkey f10 break
In TinyTERM for Windows, open the keyboard mapper and click the Chart button to open the TCS Chart. Click the F button there to bring up the function list. With the mouse pointer drag the word BREAK from the chart and drop it on the key you want to use.
Some releases of TinyTERM 4.x ignore the BREAK command from the chart. When this happens, click on the key in the keyboard mapper you want to use. Change the Action drop-down to COMMAND. In the Value field, type:
te.break();
Click the Set button to finalize the mapping.
CR 415
Posted in CScript, Keyboard, Scripting, TSL | Comments Off on Sending a BREAK Signal by a Keystroke
Monday, February 26th, 2007
You may want your UNIX application to change the TinyTERM window title. For example, you may want the title bar to show the application module when a user changes screens.
You can do this in TinyTERM 4.02 or higher by sending a CScript command from the UNIX application. The sequence:
<ESC>&oFSetPropNow(158,”Module”);AppRedraw();^M
will do what you need. Taken piece by piece, the string
<ESC>&oF
tells TinyTERM that what follows are CScript commands. <ESC> should be replaced with the Escape character, ASCII value 27.
^M
signals the end of the CScript commands. Similar to <ESC>, ^M should be replaced with the Ctrl-M character, ASCII value 13.
SetPropNow(158,”Module”);
sets the Windows title bar remark. “Module” can be replaced with any quoted string.
AppRedraw();
redraws the TinyTERM window. This forces the title bar to refresh.
Other CScript commands can be run from the host system in the same manner. For a full list of CScript commands, refer to the documentation included with TinyTERM.
CR 17
Posted in CScript | Comments Off on Let the UNIX Application Change the Title Bar
Friday, February 23rd, 2007
When printing from TinyTERM 4.02 or higher to a Windows printer, you may need to save the settings for lines and columns so it will print correctly. On some versions, every time you exit TinyTERM it loses those settings.
To save those settings, place the attached script into your .tpx file with these steps:
- Copy this script to the C:\Program Files\Century\TinyTERM directory.
- Open the Session Properties and go to the Session tab.
- Click the “Post Session Start” radio button.
- Click the Browse button
- Locate and select the st.cs script
- Click OK and close the Session Properties.
- From TinyTERM’s File menu select Printer Setup.
- Configure printing to the desired Windows printer.
- Click the Setup button to get the Page Setup dialog.
- Set the lines and columns.
- OK all settings, then save the .tpx file and exit TinyTERM.
- Restart TinyTERM.
It should have the lines and columns settings saved. You may need to set them one more time, now that the script is running.
Lines and Columns options were permanently added to the Page Setup dialog in TinyTERM 4.30. From that version on, the st.cs script is never necessary.
CR 400
Posted in CScript, Printing | Comments Off on Saving the Lines and Columns for Printing
Friday, February 23rd, 2007
TinyTERM can open up to nine sessions in a single window. However, through the included CScript language you can limit TinyTERM 4.05 or higher to one session. The script available for download here does just that. Every time a new session is opened, it checks to see if it’s the first one. If not, it immediately closes the session.
To use the script, go to TinyTERM’s Tools menu and select Script Editor. Enter the above script commands. (The comment lines set off with // are not necessary.) Click the Save button and give the script a name, such as “onesess.cs”, then close the Script Editor.
Next, go to TinyTERM’s Edit menu and select Preferences. Next to the “Application startup script” line, click the Browse button. Select the onesess.cs script and click OK. Save all settings. The next time you start TinyTERM, the script will run automatically.
This script will not work if TinyTERM is opened inside a Web browser. The browser takes over some of the functions outfirst.cs needs to catch a disconnect or session close.
There is no equivalent script that will prevent TinyTERM from being opened multiple times.
CR 566, multiple TinyTERM instances
Posted in CScript | Comments Off on Restrict TinyTERM to a Single Open Session
|