Sunday | 23 JUN 2024
[ previous ]
[ next ]

wIntegrate Scripting - Copy Menu

Title:
Date: 2023-05-09

Table of Contents

  1. An Example

wIntegrate is a terminal emulator from Rocket Software. It's a paid product and is specifically designed for multivalue systems. This means that it has a whole host of features like support for many different terminal types and import/export routines for MV data. It's quite the feature rich emulator and I'm slowly beginning to like using it a daily driver. The problem is that it is a paid product and it doesn't play too nicely with regular linux. Inside UniVerse though, no issues.

One feature that I'm only getting into now is the scripting functionality. You can basically script any part of wIntegrate. You can script links so links on the screen can be opened with your browser, you could modify how cut and paste work and all sorts.

For example if you want to modify the CopyMenu that appears when you right click, you can change it. The first step is to figure out where the file is that dictates what happens on right click. This will be under Setup.

The menus:

Setup -> Mouse

This will open the window and you can see what the definitions are for a moust button. The default for a MouseRight is:

Script "WintSys\Script\CopyMenu"

This means that the CopyMenu script is run on MouseRight. This script will be located in the install folder:

C:\Program Files (x86)\wIntegrate\wIntSys\Script\CopyMenu.wis

Now you can open this file and take a look. The manual for the scripting language is at:

An Example

I want to have a button under the paste button when you right click that will say Hello World. This will be a very simple script, just one line.

The first step is to create a HelloWorld.wis file:

Type "Hello, World!"

Now we update the CopyMenu.wis file:

Attach EditPaste, T("Paste")
AddItem Hello, T("Hello"), "Script 'C:\path\to\HelloWorld.wis'"

Here we are adding an item called Hello, that will contain the text Hello and it will execute the following script.

We can save this file and then restart wIntegrate and away we go. We should be able to now right click on the terminal, see our new button and click it. Once clicked it will print "Hello, World!".

This is just one way of setting up a script. We could also go through Setup -> Keyboard and bind our script to a specific key press. We could for example hijack Ctrl V to run our script just like how we added a mouse button.

The best thing about all this is that we could also control wIntegrate from within BASIC, meaning we could test if we are using wIntegrate and then based off that automatically enable our scripts and keys. This becomes handy when deploying wIntegrate across many work stations and we don't want to keep copying and deploying wintegrate scripts and sessions.