|
Archive for the 'Scripting' Category
Thursday, April 12th, 2007
If you set the background color to WHITE, it comes out grey. The TinyTERM background colors (BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN and WHITE) are the “darker” versions of the colors. The bright colors are reserved for the foreground.
You can make the background bright white in TinyTERM version 4.02 or higher using the CScript scripting language. No other Century Software, Inc., product allows this.
To write the script, go to TinyTERM’s Tools menu and select Script Editor. The command:
te.SetRGBEntry(7,16777215);
will make the WHITE background color bright white. You can change any of TinyTERM’s 16 colors the same way.
To set the colors to change automatically when you start TinyTERM, save the script you created using the Script Editor’s Save button. Once you’ve saved the script, go to TinyTERM’s Edit menu and select Session Properties. Click the radio button by “Post session start,” then click the Browse button below that. Select the script you created and click OK. Click OK again to close the Session Properties, then save the settings. The next time you open that session, your color settings will load automatically. You will need to do this for each session separately.
In TinyTERM version 4.9.0 or higher, you can instead edit the .tpx file in use, using any text editor. Locate the line:
RGBMap7=
Change it to read:
RGBMap7=FFFFFF
This is the hexadecimal value for bright white in the RGB color map. Other colors may be set the same way. You can use http://www.colorpicker.com to get RGB color values if desired.
Posted in Attributes, CScript | Comments Off on Bright White Background
Thursday, April 12th, 2007
If you need to debug a script, there are two ways to do it. If you are using TERM Script Language, add the following two commands, to the beginning of your script:
SET VIEW ON
SET ECHO ON
This will cause all script output and error messages to display to the TERM window.
If you are using CScript from TinyTERM version 4, you will need the Debug Monitor. Running the executable called DBMon32.exe located in the C:\Program Files\Century\TinyTERM\dbmon32 directory. After launching the DBMon32 program, you will need to launch TinyTERM with the -debug switch. For example, you could change your shortcut target to:
“C:\Program Files\Century\TinyTERM\tt.exe” -debug -PL3 default
You can also type this in at a command prompt. The quotation marks are required. After doing this, TinyTERM will display all debug information in the Debug Monitor, including script errors.
Posted in CScript, Scripting, TSL | Comments Off on Script Debugger
Thursday, April 12th, 2007
If you need to repeat the same keyboard actions repeatedly in TinyTERM 4.x, the CScript scripting language can do it. In TinyTERM 4.30 and higher, you can do this automatically through the Macro Recorder.
This tool copies the keys you type in, watches for responses from the host system, and records it all to a CScript file. To use the Macro Recorder:
- On the Tools menu, click Macro Recorder.
- In the list box, type a name for the macro. If you accept the default name, the ## signs will be replaced by numbers; e.g., KeyMac00.cs. Every new macro will be assigned a new number, one higher than the last macro created.
- Click the Record button to begin recording.
- Type the commands and other keystrokes you wish to record. You must hit Enter at least once, or the macro will not be recorded.
- Click the Pause button to temporarily halt recording and to start recording again later.
- Click the Stop button to end recording and write the macro file.
There are two ways to execute the resulting macro:
- Open the Macro Recorder. In the list box, type the name of the macro. Click the Play button.
- Click on Tools | Execute Script File. Select the macro from the list of scripts, then click the Open button.
If the macro isn’t doing quite what you expected, you can record a new macro or edit the existing one. To edit, go to the Tools menu and select Script Editor. Click the Open button to select your macro, then edit it as you need to.
You can also view a screencast that demonstrates this process. For more information on script commands, see the TinyTERM Programmers Reference Manual. You can also contact our Support department for help writing and debugging macros and other CScript files.
CR 130, added in TinyTERM 4.30
CR 724, not enabled in TN3270 or TN5250
CR 800, must hit Enter
Posted in CScript, Keyboard, Screencast | Comments Off on Macro Recorder
Thursday, April 12th, 2007
All versions of TERM for UNIX, Windows or DOS include a hostmode utility that’s accessed by typing term -x, term -1x or term-2x at the command prompt. TinyTERM Application Developer version 3.3 includes a similar feature accessed through the Action menu.
Hostmode capability was added to TinyTERM 4.x in version 4.30 through the hostmode.cs script. If your copy of TinyTERM doesn’t have hostmode.cs, you can download it here. The download version includes a utility that creates the user data file. Download the file and save it to your TinyTERM install directory, which is usually C:\Program Files\Century\TinyTERM.
To use hostmode.cs, your PC needs a modem, so you can set it up to accept an incoming call. For best results, the modem must accept typed commands. If it has a Winmodem, a modem specifically designed to work only with Microsoft Windows, the hostmode.cs script won’t be able to communicate with it properly, and the script will fail.
Nex, you’ll set up a connection on the controlling PC. To do this, open TinyTERM. Click on the Edit menu and select Session Properties.
In the Session Properties dialog, change the connection type to RS232 (Serial). Under the Available devices, select the COM port your modem is on. Then click the Setup button next to that line to set the connection speed. You probably won’t need to change anything else in that dialog.
Once you’ve set up the connection, click OK until the Session Properties dialog closes. Go to the File menu and select Save Session or Save As to save the settings.
Next you’ll need to edit hostmode.cs. To do this, Go to TinyTERM’s Tools menu and select Script Editor. In the Script Editor, click the Open button and select hostmode.cs. It will will open in a separate Notepad window.
About 25 lines down you’ll see a section labeled, “Variable declaration and initial values.” Each line after that has a variable setting and a description. These need to be changed to match your PC’s requirements.
The settings in this section of the script are fairly common and may work for your modem. But then again, they may not. If they don’t work, try to get the correct settings from your modem documentation. Most modems come with a manual or other documentation that lists the best values for these functions. If you don’t seem to have the information, gather all the documentation you can for your modem and call or email our Technical Support for assistance.
The other values in this section are mainly personal preference. If you don’t like the setting, feel free to change it. Just remember to keep the quotation marks in place, and be sure the upload and download directories you choose exist on the PC.
Once that’s done, close Notepad and save the changes. You can then click the Run button to start hostmode. If everything has been set up properly, you’ll see messages telling you that hostmode is running.
To stop hostmode, wait until no one is currently dialed in, then type Ctrl-C to exit the script. You won’t need to make further changes, so to start it again, go to TinyTERM’s Tools menu and select Execute Script File. You can run hostmode.cs from there.
CR 32
Posted in CScript, File Transfer | Comments Off on Hostmode
Thursday, April 12th, 2007
When upgrading to a newer version of TERM or TinyTERM, you can still use the older configuration files, provided they have the same extension. For example, any version of TinyTERM for Windows that uses a .tap file can use them interchangeably with earlier or later versions of TinyTERM.
If the extension for the connection file has changed, such as from .con to .tap, you will need to recreate the file, or convert the older file. TinyTERM 3.x and TERM 7.x include a utility CONVTAP.EXE. This will convert a .con file to .tap format. TinyTERM 4.x includes a CScript named TAPtoTPX.cs that will convert a .tap file to .tpx format. But there is no utility to go from .con format to .tpx.
Posted in CScript, General | Comments Off on Using Older Configuration Files
Thursday, April 12th, 2007
Once a TERM Script or CScript is running, you can’t change its behavior. You can still edit the file, but TinyTERM and TERM cache scripts in memory when they’re executed. So any changes you make will not be read until the next time you execute the script.
Posted in Scripting | Comments Off on Updating a Script on the Fly
Thursday, April 12th, 2007
When TERM for UNIX displays this error, test cu or uucp against the same port. If either of those works, there may be a lockfile on the port. To bypass that, enter the command:
term -i
If that fails, list the port explicitly in the command line:
term -l/dev/ttyS0
Replace ttyS0 with the actual tty port. You can also combine this with the -i command-line parameter.
If everything above checks out, look at the number you’re dialing with the CALL command. The # character will cause the “unknown transport” error. This is problematic, particularly if your phone system requires you to dial something like #8 to get an outside line.
CR 412, CALL
Posted in Connect, TSL | Comments Off on Unknown Transport
Wednesday, April 11th, 2007
TERM has several of the function keys preset for certain actions, such as opening the menu or help. You can reset those by editing the .termsys file in UNIX, or the term.sys file in DOS. Search the file for lines that start with the word setkey; for example:
setkey f1 menu
Change the word after the function key name (in this example, menu) to reset:
setkey f1 reset
This will reset the keys to their default values the next time you start TERM.
Posted in Keyboard, TERM, TSL | Comments Off on Disable TERM Preset Keys
Wednesday, April 11th, 2007
Using TinyTERM 3.3 on Windows 95, when executing a batch file from within a script, you may get a syntax error instead. When this happens, make sure the *.bat file is located in a directory listed in the system PATH.
Posted in TSL | Comments Off on Syntax Error Running Batch File
Wednesday, April 11th, 2007
Using any version of TERM for Windows, or TinyTERM Application Developer 3.3, you can remove the product name from the Window title. Doing this will allow the minimized label to show only the connection name.
- Edit the file WTERMUS.CMD using any text editor.
- Search for t_wtitle until you find these lines:
setvar t_wtitle t_sysverb
if trim (sysvar(20)) !=”
setvar t_wtitle t_wtitle +’-‘ + sysvar(20)
endif
- Change the third line above to read:
setvar t_wtitle sysvar(20)
- Save the changes to the file. The next time you start TERM, the window title should reflect the changes.
Posted in TSL | Comments Off on Remove “TinyTERM Application Developer” from Title Bar
|